0
votes

I have an application that I'm running on OSX, and I have this AppleScript that was working on 10.9, but it seems that it does not work on 10.10

try
    tell application \"System Events\" to set processPath to application file of application process "My Application"
    return POSIX path of processPath
    on error errMsg
    return ""
end try

When I run this in the AppleScript editor, it gives me the error that "System events got an error: Can't get application process "My Application".

I checked the Activity Monitor, and indeed, there is no process called "My Application" in there. The associated process with my application is now registered by the name "SWT". I confirmed this by killing the "SWT" process, and it killed my app.

My question is, what has changed from 10.9 to 10.10, and why is my application registered as SWT process, instead of "My Application", as it was in 10.9? Additionally, what changes do I need to make in order to register the process by the name of "My Application" (something which I presume will work)?

Update: I tried setting the Application name to "My Application", which worked, and now I am able to see a process called "My Application" in the Activity Monitor, but the AppleScript is still not working. The error that I'm getting now is:

Can’t make alias \"Macintosh HD:Library:Java:JavaVirtualMachines:jdk1.7.0_71.jdk:Contents:Home:bin:java\" of application \"System Events\" into the expected type

Any thoughts on this?

1

1 Answers

0
votes

I might have misunderstood your question but if you just want to change your app name from SWT to your application name try this

     Display.setAppName("My app name");

This should be set before any display class is initialized.