(*
RapidWeaver Add-ons Version Identifier
Have you been asked by your 3rd party RapidWeaver Add-on developer which version of their product you are using? Not really sure how to get that information?
Use this script to help you determine which product version you are currently running.
by Adam Merrifield <http://seydoggy.com>
r1.2 11-03-09 10:33
- modified reveal of package contents
r1 11-03-09 00:22
- initial release
*)
-- 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"
else
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. Sorry.\n\nWould 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
else
display dialog "The version information:\n\n" & rwInfo & "\n\n ...has been copied to your clipboard." buttons {"OK"} default button (1)
-- copy to clipboard
set the clipboard to rwInfo
end if
end tell