I have an applet set to launch my favorite apps. (I do “launch” instead of “activate” to launch them in the background while I work.)
Sometimes when I get a new version of an app (same Type & Creator), I keep the old one around for a while. When I edit my script, I purposely misspell the app’s name to force AppleScript to bring up the Std File Get dialog so as to force it to choose my newest version of the app.
But when run (even across restarts), all-too-often my old verson still launches.
(I vaguely recall that in Mac OS 9 & below, the way the Finder’s Desktop Database worked was that between two apps of the same Type & Creator, the one last launched would get precedence. Dunno’ if Mac OSuX still works similarly.)
In any event, it’s a nuisance. Anyone have a solution, short of deleting the old app?
I wasn’t sure if you wanted your app(s) to launch a stratup, or when you need them? I’ve only just started to experiment with this, but if you don’t mind them starting up at startup, have you tried using the Account option in the system prefences.
select the apps you want to load up, and add them to the list. Check them off if you want them to launch in the background.
Hopefully this helps? or gives you some options
Doing so doesn’t launch them in the background. Even if the “Hide” checkbox is used, they all seem to open in parallel, bringing the Mac to its knees.
On the other hand, using “launch” in the AppleScript applet (as opposed to “activate”) seems to go much smoother. Not only do they open in the background, many apps don’t launch until the prior one is open, much less taxing on the CPU.
The main question, however, is why isn’t the app I’ve chosen to launch honored, instead of the old one?
well, i’m not sure why that happens, but there’re several solutions.
one would be: adding a condition to your script to make sure that your app’s name and location (path, that is) haven’t changed, before it launches. this way, if you change your old app’s name (adding “old” to it of somethin’) or move it to a different folder, the script will prompt you to locate the new app, and store it as a property.
some thing like that:
property theapp : ""
on run
if theapp is "" then
set theapp to (choose file)
set thepath to theapp as text
end if
if (theapp as text) is thepath then
else
set theapp to ""
run
end if
tell application (theapp as text) to launch
end run
if you want to launch more than 1 file you can either use:
property thapp1 : “”
property thapp2 : “”
property thapp3 : “”
etc.
and repeat the above code as necessary, or be more elegant and use: property theapps : {“” ,“”, “”} and a repeat block.
another solution is to simply use an exact pathname in a variable or property to refer to the app, that way if the new app has the same name a location of the old one, it will run instead of it.
the main idea is to create a specific file reference, rather then ‘application “app name”’ which will return an alias that will follow the application wherever it goes.