1

When launching an application using applescript, I am not getting the splash screen

I am trying to launch an application and open a file using applescript. I am using this script in my c++ project. The application launcher code goes some what like this:

do shell script \"osascript -e 'tell application \"Finder\" to open POSIX file \"
<file_path>\" with the application \"<application_path>\"'\r\"".

I am sorry that, i don't remember the exact command right now. I am using NSAppleScript to run the script in my project. The application is launched corretly. But splash screen in missing. (Application that I am trying to launch is adobe illustrator.

I had also tried the system command. system("open \"<application_path>\" --args \"<file_path>\"").

By this way, I was able to get the splash screen working, But, if the application was already running, it won't attempt to open the file. There might be some error in the code that I posted.

4

1 回答 1

2

使用带有-a选项的命令打开,如下所示:

open -a <application_path> <file_path> 
于 2014-04-27T14:57:32.337 回答