Name of applet

This code shows many AppleScripts as “applet”. How i can get name of these processes? I want to use ps in this case, not “tell application “System Events” to get name of processes”.

(do shell script "ps -Acr -o command | sed 1d | sed 's/^ *//'")

Hi,

the easiest way is to add the appropriate information in the info.plist file of the applet

I tried these instructions:

Applescript saved as application bundle displays as ‘applet’
http://macscripter.net/viewtopic.php?id=25707

But it always fails.

Let say that my app name is myappname.

I changed in plist CFBundleExecutable to myappname

I also tried to change applet.rsrc to myappname.rsrc

After these changes my app icon changes to circle with backslash and it don’t even launch and i need to get copy from backup to get it back to working.

Thanks

This works for me:

assuming the name of the applet should be myApp

rename the name in Finder to myApp

in the bundle of myApp
rename the executable in ./Contents/MacOS to myApp
rename the .rsrc file in /Contents/Resources to myApp.rsrc

in info.plist of the applet
rename the key CFBundleExecutable to myApp
rename the key CFBundleName to myApp

I tried your instructions and now when i try to launch it, it appears in Dock for split second then disappears.

Console errors:
com.apple.launchd.peruser.501[90] ([0x0-0x194194].myappname[31423]) posix_spawn(“/Users/cirno/Desktop/myappname.app/Contents/MacOS/applet”, …): No such file or directory
com.apple.launchd.peruser.501[90] ([0x0-0x194194]. myappname[31423]) Exited with exit code: 1

But, when i skipped this

rename the .rsrc file in /Contents/Resources to myApp.rsrc¨

then it works.

Thanks

Now when i saved apps again, i get “Press run to run this script”.

When i saved it, i unchecked Startup Screen check box. How i can fix this?

Thanks

If i install Xcode to Lion and then create new AppleScript app using AppleScript Editor, then does this code work properly and show running AppleScript with real name. Now Lion still shows “applet” if i create scripts in AppleScript Editor.

(do shell script "ps -Acr -o command | sed 1d | sed 's/^ *//'")