Help file for AlphaUpdater version 1.0.

Introduction

AlphaUpdater is a background only application (BOA) meant to handle the installation of Alpha updates. This document demonstrates how to use it from the AppleScript editor or any external application.
It has no user interface, yet it is not a command line tool: it is designed to be driven via AppleEvents. It can thus be invoked by any application: in particular, AppleScript Editor will allow you to use it in scripts written in the AppleScript language.
Unless you are a developer, this application will be little use to you but it is used by Alpha itself to manage the release of new versions and warn the user about them. Alpha has a core command called alphaUpdate which makes use of AlphaUpdater.
The following sections provide the necessary information for developers about the available features.

Syntax of AlphaUpdater

AlphaUpdater is AppleEvent driven: you can either invoke it from an AppleScript script using its terminology or send it an AppleEvent, directly or through any programmatic interface. The next sections explain the syntax to do this in both cases and provides examples.
Note that AlphaUpdater quits automatically after executing each command.
The terminology to use AlphaUpdater with AppleScript can be found by opening its dictionary from the AppleScript Editor.

Installing a new release of Alpha

AlphaUpdater has an AppleScript command install which expects, as its direct parameter, the path of the distribution file you want to install.
This command also accepts two optional arguments:
restart
a boolean value telling if the Alpha application should be launched after installation.
in
a string value designating the directory in which Alpha is to be installed. By default, it is the Applications folder.
Here is an example of use with AppleScript:
tell application "AlphaUpdater"
    install "/Users/myname/Downloads/Alpha_9.0rc2.dmg.zip"
end tell
Here is how you would obtained the same result using the TclAE extension in a Tcl script in Alpha:
set updaterApp [file join $APPLICATION Contents Resources Libraries Extras AlphaUpdater.app]
set psn [tclAE::launch $updaterApp]
set distFile [file normalize ~/Downloads/Alpha_9.0rc2.dmg.zip]
tclAE::send -r "$psn" AlUp Inst ---- utxt("$distFile")
Another example telling to install in the user's Applications folder (~/Applications) and to restart:
tell application "AlphaUpdater"
    set distFile to "/Users/myname/Downloads/Alpha_9.0rc2.dmg.zip"
    set destination to "/Users/myname/Applications"
    install distFile in destination with restart
end tell    
The same event in Alpha would be:
set updaterApp [file join $APPLICATION Contents Resources Libraries Extras AlphaUpdater.app]
set psn [tclAE::launch $updaterApp]
set distFile [file normalize ~/Downloads/Alpha_9.0rc2.dmg.zip]
set destDir [file normalize ~/Applications]
tclAE::send -r "$psn" AlUp Inst ---- utxt("$distFile") Rsta \
	[tclAE::build::bool 1] Dest utxt("$destDir")
Technically, the install command is an AppleEvent AlUp/Inst and the optional parameters restart and in have codes Rsta and Dest respectively.
In the examples above, replace myname by your actual user name.

Launching or restarting Alpha

AlphaUpdater has an AppleScript command restart which expects, as its direct parameter, the path of the application file you want to launch.
This command also accepts an optional argument:
after
an integer value representing a delay in seconds before launching Alpha. By default, there is a 2 seconds delay.
Here is an example of use with AppleScript:
tell application "AlphaUpdater"
    restart "/Applications/Alpha.app"
end tell
Here is how you would obtained the same result using the TclAE extension in a Tcl script in Alpha:
set updaterApp [file join $APPLICATION Contents Resources Libraries Extras AlphaUpdater.app]
set psn [tclAE::launch $updaterApp]
tclAE::send "$psn" AlUp Rsta ---- utxt("/Applications/Alpha.app")
Another example telling to restart after a 5 seconds delay:
tell application "AlphaUpdater"
    restart "/Applications/Alpha.app" after 5
end tell
The same event in Alpha would be:
set updaterApp [file join $APPLICATION Contents Resources Libraries Extras AlphaUpdater.app]
set psn [tclAE::launch $updaterApp]
tclAE::send "$psn" AlUp Rsta ---- utxt("/Applications/Alpha.app") Dlay long(5)
Technically, the restart command is an AppleEvent AlUp/Rsta and the optional parameter delay has code Dlay.
In the examples above, replace myname by your actual user name.

Miscellaneous

AlphaUpdater has an AppleScript command display version to get its own version number. This command does not expect any argument.
Here is an example of use with AppleScript:
tell application "AlphaUpdater"
    display version
end tell
Here is how you would obtained the same result using the TclAE extension in a Tcl script in Alpha:
set updaterApp [file join $APPLICATION Contents Resources Libraries Extras AlphaUpdater.app]
set psn [tclAE::launch $updaterApp]
set res [tclAE::send -r "$psn" AlUp Vers]
tclAE::getKeyData $res ---- TEXT


Last updated 2018-12-21 09:14:34.