Chapter 7. Scripting the Licence Details

Example 7.1. 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

Example 7.2. 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

Example 7.3. Apply Licence Code

Set the licence details and code for Power Manager.

tell application "Power Manager"
    tell Legal
        license name "Graham Miln" organisation "Personal" code "PM4-..."
    end tell
end tell

[Note] Useful for Deployment

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