I know that command and ive tried it too… but it also results in that error of undefined variable…
Did you understand the concept of variables?
In your case, you didn’t define a variable named
id. You have to replace the placeholder
id from the documentation by the name of your variable,
original, as I proposed in the code snippet in my previous post.
Did you read:
“Returns the unique ID (a negative number) of the active image. Use the selectImage(id), isOpen(id) and isActive(id) functions to activate an image or to determine if it is open or active.”
“Activates the image with the specified ID (a negative number). If id is greater than zero, activates the idth image listed in the Window menu. The id can also be an image title (a string).”
You use both calls like this:
myID = getImageID(); // get the id (**a negative number**) of the frontmost image // do whatever you want with whatever images // ... // if you now need to work on the image with id 'myID' then use selectImage(myID);// activate the image with id 'myID'
myImageName = getTitle(); // get the title **string** of the frontmost image // do whatever you want with whatever images // ... // if you now need to work on the image named 'myImageName' then use selectImage(myImageName);// activate the image named 'myImageName'
Don’t mix both approaches!
May I ask who has edited my post and why the remark to not mix the two approaches was deleted.
Editing should be left to the poster!
I edited to improve the formatting only. The remark was still there (100% agreed that editing should never be done to change the content of someone else’s post!), but due to a bug in the Markdown support, it was not being shown. I will edit again to fix matters.
I also agree 100% that these two approaches should not be mixed.
Thanks Herbie, it makes sense, and i wont mix these two approaches