Re: Program arguments
Re: Program arguments
- Subject: Re: Program arguments
- From: Bill Briggs <email@hidden>
- Date: Mon, 21 May 2007 12:28:25 -0300
Knowing something about the application would be good, but in the absence of that, you might have to pipe the arguments in, as you do in an application like bc.
If you want to pass anything from stdin to bc (as opposed to interactive mode) you need to write it like this.
echo "last=0;for(x=1;x<100;x++) print (last + (1/(x^2))), \" \n\"" | bc
and bc takes the input and your result appears in stdout. I suspect that piping the arguments would work, but as I say, not knowing what the application wants makes it difficult to say for sure. Note that the above expression would have to be put in a "do shell script" statement and the appropriate characters escaped for AppleScript.
But the simple use of "options", as suggested by Tobias, may work. We're in the dark a bit here.
- web
At 5:18 PM +0200 5/21/07, Tobias Langlotz wrote:
>Can you call your application via command line?! Then this shoud be easy like example below:
>
>do shell script "ls -al"
>
>Hope this helps!?
>Cheers Tobias
>
>
>Am 21.05.2007 um 17:04 schrieb Mike Dougherty:
>
>>Hello,
>>
>>I've searched all over the place for an answer to this and have found nothing. So I joined this list and will pose my problem here in hopes someone has a solution.
>>
>>I have an application that uses command line arguments to determine how it should behave when it runs. This appears to be an oddity when trying to make this application work with a Mac. So I thought I would wrap these command line options in AppleScripts in order make it easier for the users. However, now that I've spent 2+ days looking for an AppleScript solution, I am wondering if this is even possible either. So my question is: How do I pass command line arguments to an application in an applescript?
>>
>>I would have expected something like:
>>
>>tell application "Foobar" with arguments {"baz", "quux"}
>> launch
>>end tell
>>
>>But that doesn't work, nor does anything else I've tried.
>>
>>Thanks for your time and help,
>>Mike
>>
>>
>>
>>--
>>*********************************
>>Mike Dougherty
>><mailto:email@hidden>email@hidden
>>858.232.3635
>>
>><http://www.google.com/talk/>http://www.google.com/talk/
>>*********************************
_______________________________________________
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