Re: osascript shell commands using AppleScript
Re: osascript shell commands using AppleScript
- Subject: Re: osascript shell commands using AppleScript
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 24 Jun 2008 18:02:39 -0400
On Tue, Jun 24, 2008 at 5:53 PM, Bill Cheeseman <email@hidden> wrote:
> Then when Installer runs the script during installation, the call to 'first
> item of args' would return the value of $1. Is that your expectation?
Right. If you put your entire script inside an "on run" handler with
a single list parameter, then when that script is executed, the
parameter will have the command line arguments. "first item of blah"
will be $1, "second item of blah" will be $2.
> But then how do I get the environment variables that PackageMaker/Installer
> provide?
That is a good question. I don't know how to access the environment
from AS, or even if it's possible. But you can always use do shell:
set PATH to (do shell script 'echo $PATH')
>
> What I'm doing right now is using a bash script file. It works perfectly
> well, but I'm curious how to convert it to an osascript shell script that
> has the same access to the parameters and environment variables. Here's my
> bash script:
>
> #!/usr/bin/env bash
> installedPath="\"$2\""
> osascript <<END
> tell application "Finder" to update POSIX file $installedPath
> END
>
> --
>
> Bill Cheeseman - email@hidden
> Quechee Software, Quechee, Vermont, USA
> www.quecheesoftware.com
>
> PreFab Software - www.prefabsoftware.com
>
>
> _______________________________________________
> 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
>
--
Mark J. Reed <email@hidden>
_______________________________________________
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