Hello to everyone !.
A new comer here to MacScripter !
I am looking for an easy way to get path to an application without it being launched.
I tried
set PathToiCal to path to application "ical"
But it lauches iCal everytime i run it !
I am doing a little app that moves all the Appleās Apps from the subs-folder I created in the Applications folder (iPhoto for exemples is in /Applications/Images/) back into the Applications folder so when i do one of Appleās Update I donāt get errors about missings Apps.
I wanted to distribute this app for the good of everyone, so i cannot hard code the path to the Apps i want to move.
You can also use Apple System Profiler to get references to all apps in the Applications folder. The hard part is that some apps have their own folders. In that case, you would want to move the folder, but how can you tell if the app had a folder?
If you want just a few references to apps, then you could use the application file id. You would need to know the creator type if there is one. You can get the creator type like this:
set r to path to application āiCalā
file creator of (info for r)
This returns āwrbtā which is the file creator or creator type. Then use the Finder to get a reference knowing the creator type:
tell application āFinderā
set ical_reference to (application file id āwrbtā) as alias
end tell
Thanks Kel, the app file ID was the solution. I am going to do some more testing with the app, and then submit the app/code here, to the AS masters of Macscripter.net.
@ Sitcom, I didnāt use your solution, as i knew exactly which apps i wanted to move, and as there is about 10 or more, asking the user for where they were, would have been a major flaw IMHO.
Anyway, thank you to both of you. And again sorry for the delay (and bad english :))