• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Applescript question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript question


  • Subject: Re: Applescript question
  • From: Graff <email@hidden>
  • Date: Fri, 04 Jun 2004 11:58:23 -0400

You need to use multiple -e flags in one osascript call:
----
osascript -e 'set username to do shell script "whoami"' \
-e 'mount volume blah....' \
-e 'mount .....'
----

The backslashes at the end of each line are just the shell method of breaking long lines into shorter ones.

- Ken

On Jun 4, 2004, at 10:36 AM, Betsy Ward wrote:

Hi,

I have a question, I'm trying to get a mount network drives script to work
and am trying to put some commands from an applescript into a shell
script. The reason being that I can't get it to work in 10.3 using the
LoginHooks the way that it works in 10.2. So I'm planning on putting it
in the profile to run after each user logs in.

Here's what's in the apple script:

set username to do shell script "whoami"

mount volume "afp://server/" & username on server "server" as user name
username
mount volume "afp://server/folder" on server "server" as user name username
mount volume "afp://server/folder" on server "server" as user name username

my question is that if I put this in a shell script how do I separate the
different commands. For instance do I need to start each line with

osascript -e 'set username to do shell script "whoami"'
osascript -e 'mount volume blah....'
osascript -e 'mount .....'

Or can I do it all after one osascript -e command, like

osascript -e 'set username to do shell script "whoami"; mount volume
blah...; mount volume ....'

Does that make sense?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Applescript question (From: "Betsy Ward" <email@hidden>)

  • Prev by Date: Documentation for "Standard Additions"
  • Next by Date: Re: Image Events
  • Previous by thread: Applescript question
  • Next by thread: making new attendees in iCal
  • Index(es):
    • Date
    • Thread