anothersmurf

Q: How can I set a version number for an AppleScript application?

Subject kind of says it all... I've written a small application in AppleScript, which is used on several computers. I'd like the application to have a version number, just like normal applications have. How do I give it one?

 

To be clear, what I mean is: in column view, if you click once on an application, it shows the icon, name, size, version, etc. of the application. I want a version number to show up there (and in the Get Info window, etc.)

Posted on Jun 21, 2011 1:28 PM

Close

Q: How can I set a version number for an AppleScript application?

  • All replies
  • Helpful answers

  • by Austin Kinsella1,

    Austin Kinsella1 Austin Kinsella1 Jun 21, 2011 2:23 PM in response to anothersmurf
    Level 6 (11,514 points)
    Mac OS X
    Jun 21, 2011 2:23 PM in response to anothersmurf

    You would have to take the non-trivial step of moving to XCode and ApplescriptObjC.

  • by Camelot,Solvedanswer

    Camelot Camelot Jun 21, 2011 2:30 PM in response to Austin Kinsella1
    Level 8 (47,243 points)
    Mac OS X
    Jun 21, 2011 2:30 PM in response to Austin Kinsella1

    No you don't.

     

    Ctrl-click the app in the Finder and select 'Show Package Contents' and navigate to Contents/Info.plist

     

    This is a .plist file that contains data about your application. You can edit this with any application capable of editing .plists and add either a 'Bundle version' or a 'Bundle version string, short' key with the value you want.

     

    Sure, XCode can add this resource automatically as you build your app, but it isn't a prerequesite.

  • by twtwtw,

    twtwtw twtwtw Jun 21, 2011 2:33 PM in response to Camelot
    Level 5 (4,935 points)
    Jun 21, 2011 2:33 PM in response to Camelot

    it would probably also help to give it a unique bundle identifier.  Launch services won't keep track of versions of a script app unless the app can be uniquely identified with respect to other apps.

  • by twtwtw,

    twtwtw twtwtw Jun 21, 2011 2:40 PM in response to twtwtw
    Level 5 (4,935 points)
    Jun 21, 2011 2:40 PM in response to twtwtw

    P.s.  It appears you need to open the script app in the AppleScript Editor after you've changed and saved the plist file and then re-save it in order for the version info to appear in the Get Info pane. 

  • by Austin Kinsella1,

    Austin Kinsella1 Austin Kinsella1 Jun 21, 2011 3:06 PM in response to Camelot
    Level 6 (11,514 points)
    Mac OS X
    Jun 21, 2011 3:06 PM in response to Camelot

    You learn something every day! Thanks for the correction, Camelot.

  • by hary5366,

    hary5366 hary5366 Mar 12, 2013 4:17 PM in response to Camelot
    Level 1 (1 points)
    Mar 12, 2013 4:17 PM in response to Camelot

    Posting to this old post, but I am trying above method on my 10.8.2 machine and it doesn't seem to work.

    I added the bundle version string as in the attached image.

    Recompile my app, saved it but still version info doesn't show up in finder.

     

    Also, tried to change "Bundle version" to "CFBundle version". But still didn't work.

     

    Any suggestions?

     

    Screen Shot 2013-03-12 at 4.15.58 PM.png

  • by twtwtw,

    twtwtw twtwtw Mar 13, 2013 6:21 AM in response to hary5366
    Level 5 (4,935 points)
    Mar 13, 2013 6:21 AM in response to hary5366

    There are two keys to note here:

     

    • Bundle Version (CFBundleVersion): the full version number (often used by developers to identify individual builds)
    • Bundle Versions String, Short (CFBundleShortVersionString): the string representation of CFBundleVersion that appears in the Get Info dialog.

     

    It's easy to get them confused.

  • by hary5366,

    hary5366 hary5366 Mar 13, 2013 9:18 AM in response to twtwtw
    Level 1 (1 points)
    Mar 13, 2013 9:18 AM in response to twtwtw

    Thanks. That helped. It works now.