Scripting Photoshop 7

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Andrew

Scripting Photoshop 7

Post by Andrew »

I am considering converting some of my scripts to Photoshop 7 but don't know enough about the capabilities other than that there is no UI.

Can you:

1. Read and write external files

2. Rename files, copy files.

3. Is there a Camera Raw for PS7 - can they do any raw processing?

4. More generally what are the limitations and will CS2 scripting mostly work for PS7?

I know a lot of questions, any responses appreciated. I have a feeling there are a LOT of people out there still running on PS7 and in some ways they need scripting more than those with the later versions.

Andrew
xbytor

Scripting Photoshop 7

Post by xbytor »

Andrew wrote:1. Read and write external files
Yes.
2. Rename files, copy files.
Yes.
3. Is there a Camera Raw for PS7 - can they do any raw processing?
There are RawFormatOpenOptions and RawSaveOptions classes in PS7. Beyond that, it's not clear how extensive the raw support actually is as I never did any raw work with PS7.

4. More generally what are the limitations and will CS2 scripting mostly work for PS7?
1. No Path classes of any kind, but some of that you can get around via ActionManager code. Tedious but possible.
2. Selection support is weak.
3. Much better docs in CS/CS2.
4. The File/Folder is undocumented. I had to write ActionManager code for File.openDialog. File and Folder selectors just don't exist and I don't have a clue as to what ActionManager code would be required.
5. app.fonts does not exist nor do the TextFont classes.
6. No app object. I usually use this snippet at the top (file) level in the application script to get around that problem.
Code: Select allvar app; if (!app) app = this;

I've written some code (in stdlib.js) to get around absent support in PS7-JS, but somethings, like the missing app.fonts, just cannot be worked around.

I know a lot of questions, any responses appreciated. I have a feeling there are a LOT of people out there still running on PS7 and in some ways they need scripting more than those with the later versions.
Two of my clients still require PS7/CS/CS2 support. My typical approach is:
1) Develop and test in CS2
2) Port to PS7 and test in PS7
3) Retest in CS2
4) Repeat 2 and 3 until done
5) Test in CS
6) If something is broke in 5 (rare) fix and retest in PS7/CS/CS2
7) Document as needed

Did I mention I do a lot of testing? Even with all of this testing, I still occasionally forget stuff like switching the script into PIXELS mode from INCHES or whatever. My normal mode of operation is PIXELS so I nothing is wrong until the customer gets the code and their default mode is INCHES.

Sometimes in Step 2 I find that something just won't work and I may not be able to port. But I can usually find a way to gracefully degrade the functionality requested and provide that as an alternative for people who are absolutely stuck in PS7.