Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Extracting machine from app specifer

Extracting machine from app specifer
Thread Tools
grhowes
Guest
Status:
Reply With Quote
Jun 14, 2000, 09:05 PM
 
If in AppleScript, I use the command:
"choose application"
I'll get a result of the form:
application "Finder" of machine "Barclay"

what I'd like to do is take this result and convert it to a reference to the Apple Video Player, but in order to do that I need to extract the machine name. How do I do this? Taking the result "as string" just returns "Finder"
     
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status: Offline
Reply With Quote
Jun 17, 2000, 03:07 AM
 
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).]
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:00 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2