Benches Uncategorized

4

path to application without it running

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I am trying to use the "path to application" command in a script I am updating, but the application insists on starting up (the previous OS9 version would just ask for the location of the application at compile time). I don't need to use anything in the application itself, just read some text files in the application package. I have seen the method that uses creator codes, but the package does not have one, and neither does it's Unix executable - is there something that just gives me the path to a package without running the application?

4 replies

Sign in or join Beachball Help to reply.

  1. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    The package does not have a creator code yet it's got a bundle identifier, you know, that "com.apple.garageband" thingie. I think that whatever mean you used with creator code you can use with bundle identifiers instead.

  2. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    The bundle identifier just looks like it is treated as any other file information, although the default application field returned with 'info for' looks promising. Previously, in OS9, you could get the path to a file with the specified ID/creator, but now AS cheats by starting the application and getting the path to the current application. By using the standard file dialog I can get the application information, but of course the dialog has the full path - everything else I have tried so far opens the application first. I am hoping that the system keeps track of the applications in some accessible way and I don't have to search through everything (the find command seems to be broken as well).

  3. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Not sure I understand what you reply means, is that a solution for you or not?

    Did you try:

    tell app "Finder" to set thePath to (application file id "com.apple.itunes") as alias

    (replacing of course "com.apple.itunes" with the appropriate bundle identifier)

    ?

  4. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Sorry about that.

    The first couple of times I used that the application still ran, so I was using various "path to" things. Setting to the application file id does work - there must have been something goofy in my code around that statement (goofy code is my specialty), since it started working after I rearranged things.

    Thanks!