Scripts from CS2 dont work with CS5
August 26, 2011 1:26 PM   Subscribe

Scripts written when I had Photoshop CS2 arent playing nice with Photoshop CS5.

A mefi friend wrote me 2 wonderful little scripts that helped me with rotating photos in batch operations when I was using CS2. I have a TON of actions with these scripts built in. Since upgrading to CS5 and re adding these two scripts to the /presets/scripts/ folder, when I go to load them I get the following error:

Error 1302: No Such element
Line: 1
-> doc = app.activeDocument

How can I get them to play nice with CS5 and save me untold hours of work?

Thanks!



the files are:

forcelandscape.js

Which contains:
doc = app.activeDocument;
if (doc.height > doc.width && doc.info.instructions != "rotateback")
{
doc.rotateCanvas(90);
doc.info.instructions = "rotateback";
}




and

rotateback.js

which contains:
doc = app.activeDocument;
if (doc.info.instructions == "rotateback")
{
doc.rotateCanvas(-90);
doc.info.instructions = "";
}
posted by sandra_s to Computers & Internet (3 answers total)
 
The activeDocument property seems to be the same in CS5. I would try adding a var in front of the doc variable declaration: in both scripts, change the first line to

var doc = app.activeDocument;

If that doesn't work, the scripting documentation for CS5 can be found here.
posted by girih knot at 1:52 PM on August 26, 2011


Response by poster: Nope. That didnt do it. Now the error is:


Error 1302: No Such element
Line: 1
-> var doc = app.activeDocument

Thanks for trying though :-)
posted by sandra_s at 3:56 PM on August 26, 2011


Best answer: Howver, you made me think! when I investigated it turns out htat Adoce makes 2 install folders. one in the Program Files Folder and one in the Program Files (x86) folder. Both with the same structure. I had copied them to only one of the folders. I put it in both and they worked.

THanks for the point in the right direction!
posted by sandra_s at 4:08 PM on August 26, 2011


« Older A diagram is worth a thousand words   |   Fried motherboard frying psu's? Newer »
This thread is closed to new comments.