I have an OS X app that a script I wrote opens. Unfortunately, it opens a copy of the app buried deep in the XCode development directories.
I renamed the app, and the open line in the script changed, and I can’t change the script back to the correct name.
The line now reads
tell application "XX_LRotor" to activate
and it should read
tell application "LRotor" to activate
How can I unhook it from that copy, and have it open the one in the applications folder?
Both the compiled script and the app are in the Applications folder.
Model: MacBook Pro
Browser: Safari 536.26.17
Operating System: Mac OS X (10.8)
You can specify a version for it by the version property of the info plist file that resides in the Contents folder of your app, as OS X will start the app with the highest version number.
And if that doesn’t work, then set a number for the short version property CFBundleShortVersionString. You can read about this here.
I use to set both, but I think you only need to set CFBundleShortVersionString, as it denotes the release number.
Thanks, I’m not sure I understood your post.
There is no version in the .plist file, there is a ‘Bundles version strings, short’ and a ‘Bundle version’. Just changing those did nothing, the app would have to be compiled for the change to take effect, right?
If that’s true, then the compile would also change the copy in the developer folder, and I’d be in the same situation.
The process is inpdendent if you do it the plist file, but you can also do it in the foundation of the plist file, that gets to be “Compiled/output” by XCode.
And I forgot to mention the last point, and that is that you may have to “Register” the app with launchservices once, by executing it directly, so that launchservices know that it is the last version. This is usually no problem for me, as I do it from within XCode, and then run it from within there, before I deploy it.
Now that you know that you must somehow “register” it, I think you’ll be able to figure something out. There are also scripts out there, that you can incorporate as a build step to for instance increcement the version string, which is what I do most of the time, I do that from Organizer.
I deleted the renamed copy in the dev folder, and when I ran the script, it asked for the location of the renamed app. I browsed to the correct one, and now that opens OK.
Changing the plist file had no effect. I don’t know what “The process is inpdendent if you do it the plist file, but you can also do it in the foundation of the plist file, that gets to be “Compiled/output” by XCode.” means.
Maybe the key is in the registration. Some mechanism ties the app and the script together, else the script would not have changed when I renamed the app.
Oh well, problem solved, if not understood. Thanks.
By foundation for, I meant the InfoPlist.strings file, that resides on root level in your Xcode project.
You should really know about what you can do with the plist file, as it may save you some time, in that you can configure a whole lot of your app through that file.
The link I posted in post #2 is a great place to start, but the best document would be this.
You can also try to search for relevant documents by entering CFBundleVersionString at developer.apple.com
This is especially useful when you write applets, as you then get a whole lot for free.
Hi, I’ve found that AS can be sensitive to the file system name of the app bundle, and it’s identifier at different times. When you rename an app, try to do it with the help of Xcode, and rename it throughout the info plist. Clean and build to finish the job.