RapidWeaver Add-ons Version Identifier

RapidWeaver Add-ons Version IdentifierOne thing RapidWeaver does poorly — at this current moment — is help the end user determine the product version they are using on any given 3rd party add-on. Knowing your add-ons (theme or plugin) version number is critical when asking for support and is often one of the first things the developer will ask you for.

If you know where the add-ons are kept (`~/Library/Application Support/RapidWeaver/`) then you might be able to determine a plugin or themes version number with the Finder, or if you have RapidWeaver open you can find out a plugin’s version by opening the plugin browser, or if you show a themes package contents and…

Well, I like to have these sorts of things at my fingertips and do as little thinking as possible, so I wrote an AppleScript to gather this information for me no matter where I am or what I am doing[*][a_091103113228]:

— file types to choose from
set rwTypeArray to {“Theme”, “Plugin”}

— choose from those file types
set rwTypeLong to {choose from list rwTypeArray ¬
with prompt ”Which RapidWeaver product type ¬
you like to find the version of?” ¬
with title “Theme or Plugin”} as string

— logic from result
if rwTypeLong is “Theme” then
set rwType to “rwtheme”
set rwType to “rwplugin”
end if

— get name of hard drive
tell application “System Events”
set diskName to (get name of startup disk) as string
end tell

— get name of user
set userName to (do shell script “whoami”) as string

— select file from RW directory
tell application “Finder”
set rwFile to (choose file with prompt ¬
“Please select your RapidWeaver ” & rwTypeLong & “:” ¬
default location (diskName & “:Users:” & userName & ¬
“:Library:Application Support:RapidWeaver” as alias) ¬
of type rwType without invisibles)

— read version number
tell application “System Events”
set rwInfo to (get version of the file (rwFile as string))
end tell

— and display it
if rwInfo = “” then
display dialog ¬
“It seems that your ” & rwTypeLong & ¬
” doesn’t have a version number that I can read. ¬
Would you like me to reveal it’s ¬
package contents for you?” ¬
buttons {“Cancel”, “Yes”} default button (2)
set rwPath to rwFile & “Contents” as text
open rwPath
display dialog “The version information:nn” & rwInfo & ¬
“nn …has been copied to your clipboard.” ¬
buttons {“OK”} default button (1)
— copy to clipboard
set the clipboard to rwInfo

end if
end tell

### Notes ###

* If a theme is to have it’s version number read, it must have an Info.plist in it’s package contents. Some theme developers do not include this file. For those that don’t, the script will reveal the theme’s package contents so that you can inspect the version number at the bottom of the Theme.plist file

### Download ###

Get your fresh copy of [RapidWeaver_Addons_version.scpt][a_091103112457] from CodeCollector.net

[a_091103112457]: http://www.codecollector.net/view/BB433BE1-0BD0-43C6-AE7A-CFEE8E623AB8 “RapidWeaver_Addons_Version.scpt”
[a_091103113228]: http://seydoggy.com/2009/11/03/rapidweaver-add-ons-version-identifier/#a_091103113228


Adam Merrifield


One thought on “RapidWeaver Add-ons Version Identifier

Leave a Reply