Script to identify missing osax (using XML-RPC)
Script to identify missing osax (using XML-RPC)
- Subject: Script to identify missing osax (using XML-RPC)
- From: email@hidden
- Date: Mon, 12 Nov 2001 10:13:43 +0100
The following script uses XML-RPC to identify a missing osax in a
script. It requires OS X 10.1, but can easily be modified to use Mark
Alldritt's XML-RPC library. The example below assumes that the Satimage
osax for OS X is not installed. More information about the osaxen.com
XML-RPC interface can be found at <
http://www.osaxen.com/xmlrpc.php>.
- Martin
----------
try
+event SATIUPPE; "scripting addition"
on error errMsg number errnum
if (errnum is -1708) then tell osaxenLocator to locateCommand(errMsg)
end try
script osaxenLocator
on locateCommand(errMsg)
set theOffset to offset of "+event " in errMsg
try
if (theOffset is 0) then error
set commandID to text (theOffset + 7) thru (theOffset + 14) of errMsg
tell application "
http://www.osaxen.com/xmlrpc.php"
set commandList to call xmlrpc {method
name:"osaxen.findCommand", parameters:commandID}
end tell
if ((count commandList) is not 1) then error
set commandRecord to item 1 of commandList
set theResult to display dialog "The command \"" &
|command name| of commandRecord & "\" from the scripting addition
package \"" & |package name| of commandRecord & "\" appears not to be
installed. Do you want to go to macscripter.net for more information?"
default button 1 giving up after 6
if button returned of theResult is "OK" then open location
"
http://www.osaxen.com/index.php?id=" & |package id| of commandRecord
return 0
on error number errnum
if errnum is not -128 then display dialog "A scripting
addition is missing. No unique command was found at macscripter.net."
buttons {"Cancel"} default button 1 giving up after 6
return 1
end try
end locateCommand
end script