• 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: Osascripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Osascripting


  • Subject: Re: Osascripting
  • From: "Mark J. Reed" <email@hidden>
  • Date: Thu, 11 Mar 2010 14:54:32 -0500

At 18:18 +0100 3/11/10, ba95 wrote:
>>Thanks a lot Shane and Mark.
>>
>>Just a confirmation:
>>I must then try (cp) :
>>
>>> #!/bin/sh
>>> arch -i386 osascript -e 'tell application "Finder"' -e 'cp Folder "Test01" of disk "La Cie 640Go" to folder "Testo" of startup disk with replacing' -e 'cp Folder "Test02" of disk "La Cie 640Go" to folder "Testo" of startup disk with replacing' -e 'end tell'

No, no, no.  cp is a shell command, not an AppleScript command.  If
you're starting out in shell-land, where you would have to use
osascript to run AppleScript code, then it seems a bit silly to do so
in order to perform functions that are more readily accomplished with
shell commands directly.

I use osascript all the time, but only to do things I can't do from
the shell more easily. :)

#!/bin/sh
cp -rp "/Volumes/La Cie 640Go/Test01" /Testo

or

#!/bin/sh
rsync -a "/Volumes/La Cie 640Go/Test01" /Testo

If you're repeatedly copying files to the same target, as for backups,
rsync is better since it compares the contents of the source and
target first and doesn't bother copying what hasn't changed.

The pathnames are what you get if you ask AppleScript for the (POSIX
path of (folder "Test01" of disk "La Cie 640Go")) or whatever.
--
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

References: 
 >Re: Osascripting (From: ba95 <email@hidden>)

  • Prev by Date: Re: Osascripting
  • Next by Date: Re: EPS to PDF Watch Folder Dilemma
  • Previous by thread: Re: Osascripting
  • Next by thread: Re: Osascripting
  • Index(es):
    • Date
    • Thread