Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ARD Applescript Help



Hello everyone. I'm trying to write what I would  think is a simple
applescript (and I bet it is!) but I'm having trouble getting my head around
some of the subtleties of Applescript.

I would like to create a script that will execute a unix command on a group
of computers via ARD. The command determines the netboot server that booted
the machine. I would like the script to place the computers in groups that
have the same name as the output of the command (the netboot server
hostname).

Here is what I have so far:

tell application "Remote Desktop"
    set myNetBootList to computer list "test"
    
    set aNewTask to make new send unix command task with properties
{name:"Which Netboot Server", user:"adminx", showing output:true,
script:"netstat -W | grep 2049 | awk {'print $5'} | sed
's/\\(.*\\)\\(\\.2049\\)/\\1/'"}

    set myCommandResults to execute aNewTask on myNetBootList
    
    set stati to |computerStatuses| of myCommandResults
    repeat with aResult in stati
        
        set thisServer to results of aResult
        set thisId to |id| of aResult
        set thisComputer to computer id thisId
        
        if thisServer is in {"Offline", "Not supported", "No console user"}
then
            set thisServer to "Unknown NetBoot Server"
        end if
        
        add thisComputer to computer list thisServer
    end repeat
end tell

My problem is that the variable thisServer contains "servername" with the
quotes. I need to have it without the quotes.

Is there an easy way to remove the quotes? Am I doing this totally
backwards?

Thanks in advance!

David Rocamora Systems Administrator






This message is the property of R/GA and contains information which may be privileged or confidential. It is meant only for the intended recipients and/or their authorized agents. If you believe you have received this message in error, please notify us immediately by return e-mail or by forwarding this message to email@hidden, and destroy any printed or electronic copies of the message. Any unauthorized use, dissemination, disclosure, or copying of this message or the information contained in it, is strictly prohibited and may be unlawful. Thank you.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.