find POSIX path of a unix executable file in my application Resources

i’m making a applescript studio application and it has a unix executable file in it located at the application Resources folder.
when i run the application from xcode i could type in do shell script “./Video\ Converter.app/Contents/Resources/Converter”
and it works but when i run it by opening it with the finder it changes the folder to the hard disk.
so i have to know the POSIX path of the application so i can cd to it and use the script above.

Mr. Gecko

Welcome. :slight_smile:

For AppleScript Studio, you can use something like this:

set converter to (resource path of main bundle) & "Converter"
do shell script (quoted form of converter)

-- or, if you need to pass some parameters
-- do shell script (quoted form of converter) & " whatever"

This should also work (it’s also what you would use for “regular” AppleScript):

set converter to POSIX path of ((path to me as Unicode text) & "Contents:Resources:Converter")
do shell script (quoted form of converter)

Thanks you help me alot!