Get the full application path

Hi,
I’m new to the forum and to applescript too. So, sorry for my irritating and/or stupid questions :slight_smile:

I’m trying to make a droplet applescript application with Xcode, but i need to get the full path (well, I think unix path) of the dropped application.

In my loop i get the path with this:

set my_path to POSIX path of i

For example, if I drop Camino on my app, the path returned is /Applications/Camino.app/ but i need to get /Applications/Camino.app/Contents/MacOS/Camino

Any suggestions?

Thank you!

Hi,

welcome to this board.
Your question is not stupid at all.
The paths in AppleScript point always at the application package.
To access the binary you have to hard-code the path like this (I want to keep one line ;))

set my_path to POSIX path of i & "contents/MacOS/" & text 1 thru ((offset of ".app" in (name of (info for i))) - 1) of (name of (info for i))

Thanks StefanK,
your suggestion is working fine, but now, I’m encountering another problem… damn! :slight_smile:

I need the full application path because I’m using a script to launch the application. If I run from konsole (hemmm, terminal I suppose here :slight_smile: ) all is working fine, but from the applescript droplet, even putting at the end of command the & for the background, the application will pop up, but I can’t see the application’s icon on the dock and I can’t focus on the window for writing something… (eg, I can run Camino, I can click on links but I can’t write any URL or search strings).

The only way to quit the application is a kill -9 from terminal…

Where I’m wrong?

Thank you.

PS: nice place Sankt Gallen, I have been this summer before my trip in Austria, Germany and Czech Republic :slight_smile:

How are you running the app?

Edited: I think I see what you’re doing. Try running it with open:

open /Applications/TextEdit.app

gl,