Scripting the Licence Details

Sample AppleScripts for scripting Power Manager's licence details.

Licensed Copy

Displays a thank you dialog box if the user has licensed Power Manager.

tell application "Power Manager"
    if the state of the licence of Legal is licensed then
        display dialog "Thank you " & name of licence of Legal
    end if
end tell

Demonstration Expiry Date

Displays a dialog box showing the demonstration expiry date.

tell application "Power Manager"
    if the state of the licence of Legal is demonstration then
        display dialog "Your demo expires " & expires of licence of Legal
    end if
end tell

Apply Licence Code

Set the licence for Power Manager.

The license command is useful for automating installations and avoiding typographical mistakes.

tell application "Power Manager"
    tell Legal
        license pem "-----BEGIN CERTIFICATE----- ..."
    end tell
end tell

Apply Licence Code from a File

Set the licence for Power Manager from a certificate file.

set myCertificateFile to (choose file of type "pem") as string
set myCertficiate to read file myCertificateFile

tell application "Power Manager"
    tell legal
        license pem myCertficiate
    end tell
end tell