Re: ARD control issues
Re: ARD control issues
- Subject: Re: ARD control issues
- From: John Welch <email@hidden>
- Date: Tue, 13 Aug 2013 18:01:12 -0400
On 13 Aug 2013, at 5:12 PM, Stan Cleveland < email@hidden> wrote: On Aug 13, 2013, at 1:34 PM, Die Fledermaus wrote: I have two issues vexing me. <snip> If I try it from a list
tell application "Remote Desktop" set theListofcomps to name of every computer --get all exsisting computers in list
set compname to choose from list theListofcomps with title ¬ "Computers" with prompt "Pick the computer you want to send a message to and control" --lets tech pick from full list of machines.
set compname to (text returned of result)
the compname variable is {\"dnsname\"} and the script then fails
So how do I make the {\"dnsname\"} turn out as "dnsname" in compname?
Hi Operatic German Bat,
Try this: set compname to choose from list theListofcomps with title ¬ "Computers" with prompt "Pick the computer you want to send a message to and control" --lets tech pick from full list of machines. set compname to item 1 of result Second issue is I am trying to control the compname machine via ARD and I notice there is a control command in the dictionary. I have tried several ways to make that command work, but so far the script says it did everything correctly. I never get a window to be created so I can control the machine in question. I have tried the control command against a single machine and against a list with out any results.
Sorry, but ARD is not in my area of expertise. Someone else may be able to help with this.
some sample code for the control function that works:
tell application "Remote Desktop" set theComputer to the selection control theComputer end tell
if you comment out the control statement, you can see what ARD wants for a computer, and why using the name is causing you problems. When you create a list of names, you're creating a list of text strings, not computers. So what it returns is a text string, not a computer, and ARD is then very confused as to why you want to control a text string.
What you need to do is modify Stan's code a bit:
tell application "Remote Desktop" set theListofcomps to name of every computer set compname to choose from list theListofcomps with title ¬ "Computers" with prompt "Pick the computer you want to send a message to and control" --lets tech pick from full list of machines. set compname to item 1 of result set theComputer to every computer whose name is compname control theComputer end tell
the trick is going from the text string of the name back to a computer, which is tracked by the ID. Then you control the computer. Should work better. |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden