Re: Another Applescript noob
Re: Another Applescript noob
- Subject: Re: Another Applescript noob
- From: Dennis Cox <email@hidden>
- Date: Thu, 27 May 2010 13:14:58 -0500
- Thread-topic: Another Applescript noob
> From: Tommy Bollman <email@hidden>
> Reply-To: Applescript Users <email@hidden>
> Date: Thu, 27 May 2010 19:44:21 +0200
> To: Applescript Users <email@hidden>
> Subject: Re: Another Applescript noob
>
> Den 27. mai 2010 kl. 18.55 skrev Joy:
>>
>> I've got it working!!!! THANK YOU ALL for you input.
>>
>> You are all much nicer then the UNIX usergroups! :-D
>>
>>
>> On May 27, 2010, at 11:18 AM, Mark J. Reed wrote:
>>
>>> If you run adbind.sh in the terminal, what do you have to type? I'm betting
>>> you have to hit the return key after each of those values. Which means you
>>> need to put linefeeds between them in your string. Try 'loginname &
>>> linefeed & department ...'
>>>
>>>
>>>
>>> On Thu, May 27, 2010 at 11:00 AM, Joy <email@hidden> wrote:
>>> Just tried that. It compiled, but the result was the same.
>>>
>>>
>>> On May 27, 2010, at 10:59 AM, Bradvica, Robert wrote:
>>>
>>>> I think it should be loginname & " " & department
>>>>
>>>>
>>>> On 5/27/10 7:58 AM, "Joy" <email@hidden> wrote:
>>>>
>>>> Everytime I enter a space and hit compile, it removes the space.
>>>>
>>>> On May 27, 2010, at 10:44 AM, Bradvica, Robert wrote:
>>>>
>>>>> Is it just as simple as a space between loginname and department on line
>>>>> 7?
>>>>>
>>>>>
>>>>> On 5/27/10 7:40 AM, "Joy" <email@hidden> wrote:
>>>>>
>>>>> I'm missing something in my applescript.
>>>>>
>>>>> I've got the variables setup and the display dialogs seem to work, but the
>>>>> variables aren't being passed to the script correctly. Here's what I have
>>>>> so far for my applescript
>>>>>
>>>>>
>>>>> property loginname : ""
>>>>> display dialog "Enter your loginname without the container:" default
>>>>> answer loginname
>>>>> set the loginname to text returned of the result
>>>>> property department : ""
>>>>> display dialog "Enter your Department:" default answer department
>>>>> set the department to text returned of the result
>>>>> do shell script ("echo " & loginname & department & " |
>>>>> /Users/gvsuadmin/Desktop/adbind.sh") user name "xxxx" password "xxxx" with
>>>>> administrator privileges
>>>>>
>>>>>
>>>>>
>>>>> On Wednesday, May 26, 2010, at 05:54PM, "Mark J. Reed"
>>>>> <email@hidden> wrote:
>>>>>> _______________________________________________
>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>> AppleScript-Users mailing list (email@hidden)
>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>
m
>>>>>> Archives: http://lists.apple.com/archives/applescript-users
>>>>>>
>>>>>> This email sent to email@hidden
>>>>>>
>>>>> On Wed, May 26, 2010 at 3:18 PM, Emmanuel LEVY <email@hidden>
>>>>> wrote:
>>>>> On May 26, 2010, at 9:03 PM, Mark J. Reed wrote:
>>>>>
>>>>> You can run the script inside Terminal with 'tell application "Terminal"
>>>>> to do script "...."', instead of 'do shell script', and then the script
>>>>> can interact with the user as needed.
>>>>>
>>>>> Or if the script just expects certain things on its input but doesn't need
>>>>> a terminal, you can prompt for them with 'display dialog' and then use
>>>>> "echo" or <<< as part of the shell command to feed the input to it.
>>>>>
>>>>> Or you can use display dialog's output in line, like in:
>>>>>
>>>>> -- tested
>>>>> do shell script "ls " & (text returned of (display dialog "Enter directory
>>>>> to list:" default answer "/"))
>>>>>
>>>>> I got the impression the OP was talking about the command reading things
>>>>> from its input stream, so it'd be more like
>>>>>
>>>>> do shell script "command arguments <<<" & (quoted form of (text returned
>>>>> of (display dialog "Enter data:")))
>>>>>
>>>>> If you have to prompt for multiple data items then it's probably easier to
>>>>> do the display dialogs first and gather the results and then build the
>>>>> inputstring out of them.
>>>>>
>>>>>
>>>>>
>>>>> Emmanuel
>
> It is a tad late, I know, but today I think I used "\" \"" to create a space
> between to parameters in a do shell script.
>
>
> Best regards
>
>
>
> Tommy Bollman
> ------------------------------------------------------------------------------
> --------------------
> You will be advanced socially,
> without any special effort on your part.
>
I find that it's always good to refer to Technical Note 2065 "do shell
script in Applescript"
<http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html>
Dennis Cox
_______________________________________________
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