I think you need to drill a little deeper into the folder structure - ".app"s on Mac are bundles (fancy folders) that only Finder really knows to treat as a file.
Try modifying your executable path to something like this:
file = file.resolvePath("/Applications/Adobe Photoshop CS5/Adobe Photoshop CS5.app/Contents/MacOS/Adobe Photoshop CS5");
Hope this helps.
Moved to the Desktop Development forum
Thanks for your reply , now it's nearly reach to find solutions.
This path is working but as per click photoshop's new module is opened every time ( like 1 , 2 , 3 ,,... photoshop oped..) i don't know how can i solved this problem ,
If i create exe for window at that time only one instance of photoshop is create when next time requiest is comes at that time if photoshop already opened then it will focus. i want like this in mac also..
Please give me some solutions or direction how can i solve this,
So - are you saying that on Windows - only a single instance of PS ever runs? No matter how many times you invoke it from NativeProcess?
But on Mac - you are getting multiple instances of PS? One with each invocation of the NativeProcess call?
What happens on Mac when you launch PS manually in the Finder by dbl-clicking on the PS icon? Will it launch multiple instances or only launch one?
I can't imagine we are doing anything that would change the default PS launch behavior on Mac...
Thanks for your reply ,
It's true that when i give path of file :
Window : c:\Program Files\Adobe\Adobe Photoshop CS4\Photoshop.exe
Mac : /Applications/Adobe Photoshop CS5/Adobe Photoshop CS5.app/Contents/MacOS/Adobe Photoshop CS5
when i call native process at first time photoshop is opened
after second call of native process of same path window just set focus on opened photoshop
while in mac is open another instance of photoshop
this process is continue on every call.
Please give me direction how can i solved this so mac is also opened only one istance of photoshop as we generaly manually click on photoshop icon on mac.
>> What happens on Mac when you launch PS manually in the Finder by dbl-clicking on the PS icon? Will it launch multiple instances or only launch one?
when i launch Photoshop cs5 manually at that time only one instance is created.
Can you please give me a direction i am very near to to get solution of this.
Thanks you for your support.
We did a bit of investigation on this today and found a couple of approaches that you can take.
The first deals with the "open" system command. It appears that this command needs to be used to mimic launching an app via the dock or finder (using launch services):
var file:File = File.applicationDirectory; file = file.resolvePath('/usr/bin/open'); nativeProcessStartupInfo.executable = file; var args:Vector.<String> = new Vector.<String>(); args.push("/Applications/Adobe Photoshop CS5/Adobe Photoshop CS5.app"); nativeProcessStartupInfo.arguments = args; process = new NativeProcess();Another approach uses AppleScript. You could create a simple script such as:
tell application "Adobe Photoshop CS5" activate end tell
Then compile and save this script in a binary/application format. Once that package is created, you can call that (or actually the "Applet" binary inside the package) via AIR's native process APIs.
While both of these approaches work, it would be nice to have the ability to call the .app directly with Native Process (and get the standard Finder behavior.) I'll add a feature request into our database so the team can review the workflow and hopefully add functionality into future versions of AIR.
Thanks for giving solutions and i try
var file:File = File.applicationDirectory;
file = file.resolvePath('/usr/bin/open');
nativeProcessStartupInfo.executable = file;
var args:Vector.<String> = new Vector.<String>();
args.push("/Applications/Adobe Photoshop CS5/Adobe Photoshop CS5.app");
nativeProcessStartupInfo.arguments = args;
process = new NativeProcess();
but it's now working on mac. if you haveany other solutions like this then plz tell me.
Odd that isn't working on your system. Is it still launching another instance of Ps?
I'm sure you caught this, but it looks like my copy/paste job missed the following line at the end which starts the native process: