Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

access photoshop from external program

Hi,


I need to control Photoshop from a program written in Cocoa and I am sure there must be some interface for this. In Windows there was something like that for accessing functionality provided by binary applications - it was called OLE and COM.


I can't imagine not having this in OS X (it is so good).


Thanks,

Juan

MAC PRO, Mac OS X (10.6.8), also have MacBook Pro

Posted on Oct 12, 2013 5:18 PM

Reply
Question marked as Best reply

Posted on Oct 12, 2013 6:34 PM

OS X has AppleScript and you can use that via Cocoa with the ScriptingBridge. Photoshop does seem to have a scripting interface. I think it might be a good idea to play around with scripting Terminal, Mail, or TextEdit first. Photoshop is likely to be quite difficult. It would be better to get your feet wet with ScriptingBridge on something where there are some examples that are known to work.

3 replies
Question marked as Best reply

Oct 12, 2013 6:34 PM in response to JuanDent

OS X has AppleScript and you can use that via Cocoa with the ScriptingBridge. Photoshop does seem to have a scripting interface. I think it might be a good idea to play around with scripting Terminal, Mail, or TextEdit first. Photoshop is likely to be quite difficult. It would be better to get your feet wet with ScriptingBridge on something where there are some examples that are known to work.

Oct 25, 2013 5:44 PM in response to JuanDent

You start here. There is quite a bit to read there.


With ScriptingBridge, you run a couple of cryptic scripts and it spits out a header file that you can import and use from an Objective-C program. It looks something like this:


sdef /Applications/iTunes.app | sdp -fh --basename iTunes


If you want a pure AppleScript interface, you would have to look for documentation from Adobe. Personally, I can't make any sense out of AppleScript at all. It is like gibberish. The Objective-C is a language I can read.


There is a trick to ScriptingBridge. None of those objects are real objects. They are all proxy objects and don't work quite the way you would expect them to.

access photoshop from external program

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.