Re: Osascripting
Re: Osascripting
- Subject: Re: Osascripting
- From: Doug McNutt <email@hidden>
- Date: Thu, 11 Mar 2010 10:39:46 -0700
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'
>
>Or (rsync):
>
>> #!/bin/sh
>> arch -i386 osascript -e 'tell application "Finder"' -e 'rsync Folder "Test01" of disk "La Cie 640Go" to folder "Testo" of startup disk with replacing' -e 'rsync Folder "Test02" of disk "La Cie 640Go" to folder "Testo" of startup disk with replacing' -e 'end tell'
>
>Or are there some useless words to delete in this elementary script ?
There certainly are. Presumably the running application when you call for the copying operation is Terminal.app or perhaps an MPW-like BBEdit shell worksheet or an emacs window.
The suggestions amount to a withdrawal from AppleScript. You can call cp, CpMac, or rsynch without any use of osascript at all.
#!/bin/sh
cp -R " /Volumes/La Cie 640Go" /Testo/
which is a single line command. To find out more about the tools use a command like this:
man cp
There are lots of options that, for instance, would ask for replacement when a file already exists in the destination folder. You can also get information for use on the internet where the man(ual) pages are easier to read.
The arch -i386 is totally unknown to me. It would seem that any tool that needs to know can ask the current operating system for that information.
Just how are you calling your bash shell script? With AppleScript's do shell script command?
--
Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
_______________________________________________
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