Hi,
I am working on a simple script which involves cloning the currently selected tool and then going back and forth between the clone and the original.
The problem is that I can’t find a way to select back and forth between the clone and the original. I thought I could simply do it through the tool number using [IGet, Tool:ItemInfo] and [ISet, Tool:ItemInfo] like this:
// Record currently selected tool number
[VarSet, activeTool, [IGet, Tool:ItemInfo] ]
// Clone the active tool
[IPress, Tool:Clone]
// Record cloned tool number
[VarSet, clonedTool, [IGet, Tool:ItemInfo] ]
// Select original tool
[ISet, Tool:ItemInfo, #activeTool]
[color=black]
The code above doesn’t work because when the tool is cloned, instead of giving the clone a new number, it gives the originally selected tool a new number and gives the clone the old number. Therefore, I can’t simply record the active tool number, clone the tool, then record the cloned tool number because it’s the same number.
I can’t figure out how to find out the new number that the cloning process gave to the original tool. Is there a way or a workaround?
Thanks
By the way, is there a way to rename the active tool?
Simply by saving a tool, you also assign that file’s name to the active tool in the Tool palette. Good to know. (I assumed it had to be reloaded for the name to appear.)
It’s just not what I thought I was learning until I looked closely at the code.
Have you tried the InteractiveLight ZScript? its located in the ZPlugin palette and can be activated by pressing CTRL+P .