Hi,
This is an interesting problem... Unfortunately, if even string coercion doesn't work, then there may not be a general way to parse the machine name from an application reference. If you haven't already done so, you could probably get a more definitive answer by posting this question at the
MacScripter.net web site (which includes a BBS/Forum), or to one of the AppleScript mailing lists mentioned on the AppleScript Sourcebook's
AppleScript Mailing Lists, News Groups, Etc. links page (e.g., Apple's own
AppleScript-Users and
AppleScript-Implementors, or via
Dartmouth's MACSCRPT Hub).
An alternative method might be to use the ubiquitous
Akua Sweets OSAX instead. This OSAX provides an extended 'the server processes' command that replaces the 'choose application' command; it can be configured to return a special 'Server Process' record instead of an application reference. Then, you could retrieve the machine name via the 'proc mac' property of the Server Process record. For example:-
Code:
set theApp to (item 1 of (the server processes with prompt "Please choose an application:" as Server Process))
get proc mac of theApp
Do let us know how things turn out.
Regards,
--Paul
[This message has been edited by Paul Crawford (edited 06-17-2000).]