views:

75

answers:

1

I'm writing an application for OSX using C++ and Obj-C that interacts with Photoshop.

I've been using NSAppleScript with dynamically built AppleScripts to drive Photoshop (yes, it's a little scary...) I would love to be able to drive Photoshop a different way, so if anyone knows a better way, I'm open to it! Unfortunately, I can't use ScriptingBridge as I can't tie my users to Leopard.

The big problem came just the other night when I went to query the action list from Photoshop to display to my users. Apparently, Photoshop's scripting integration doesn't expose the action list APIs to AppleScript. Which is a second reason why I can't use ScriptingBridge.

Does anyone know a way I can access Photoshop's action list in my Obj-C/C++ program? Bonus question: does anyone know a better way I could be interacting with Photoshop?!

+2  A: 

I don't think there is a "better" way to interact with photoshop. Applescript is the way. That's what it was built for. Regarding getting a list of the actions, my only suggestion would be that the actions must be located in a folder somewhere on the hard drive. Isn't each action a separate file? I'm not sure about that but that would be an approach worth looking into. Maybe you can figure out which folders they reside in, and get the action's file names and basically recreate the hierarchy of the actions menu by querying the folder structure.

regulus6633
That's quite an intriguing idea, actually. I hadn't even considered that. I'll have to give it a shot.
Miquella
Hmm... they're not stored as individual actions. They're stored in action sets (e.g. all of the "Default Actions" are stored in a single file). I could look at parsing the actions file, but I'm not convinced I'm up for that just yet...
Miquella
as far as I can tell there is no way to get a listing of actions unless you can figure out how to interpret the atn file or somehow read the screen you'll have to find another way... maybe require the user sot only put one action in a set so that the set has the same name as the action ? idk hope that helps you in some way keep us posted
mcgrailm