Copy link to clipboard
Copied
I initialize all my action manager id this way. But it fails in one single instance..
When I try to get the ID for "name".
You would expect the code below to alert the same ID, but the first one is correct, the second one alerts "anonymous"
When I save the id to var = name; I get "Adobe Photoshop" returned.
When I save it to var = stringName it is correct. But I'm initializing a ton of ID's this way, why is this one "anonymous"?
alert(stringIDToTypeID('name'));
PSString = function() {};
PSString.name = stringIDToTypeID('name');
alert(PSString.name);
Shoudn't it be: PSString = {}
Copy link to clipboard
Copied
Shoudn't it be: PSString = {}
Copy link to clipboard
Copied
Correct, I just copied it from "PSConstants", I thought it should be just an object instead of a function...
Whats going on here is that I actually request the name of the function, since its not named, it returns "anonymous".
I fixed it, and works fine now.
Copy link to clipboard
Copied
When I save the id to var = name; I get "Adobe Photoshop" returned.
By @Marvin01
name == app.name // global variable
activeDocument == app.activeDocument
and so on...