Re: Again (corrected): how to create an applescript for multiple dd terminal commands in sequence (for multiple USB Drives duplication)
Re: Again (corrected): how to create an applescript for multiple dd terminal commands in sequence (for multiple USB Drives duplication)
- Subject: Re: Again (corrected): how to create an applescript for multiple dd terminal commands in sequence (for multiple USB Drives duplication)
- From: Axel Luttgens <email@hidden>
- Date: Sun, 02 Feb 2014 11:19:35 +0100
Le 2 févr. 2014 à 10:32, Alberto Carpenè a écrit :
> [...]
> - a file named "source.img" will be prepared and put on the desktop (say
> an .img of a bootable OS)
>
> - terminal must be asked to change directory to the desktop
>
> - with administrative privileges (the password can be inserted into the
> script, or asked once to the user) it must be asked to perform:
>
> "sudo dd if=source.img of=/dev/rdisk1 bs=1m"
>
> [...]
>
> and so on with rdisk4, rdisk5, rdisk6, rdisk7.
>
> - at the end of the disk7 operation , the script can shut down the terminal
> and send a finder message to the user (or an audio notification) that the
> USB Duplication process to the 7 flash drives is concluded.
>
> [...]
Hello Aberto,
Taking your description litteraly, this sounds quite easy; for example, for the first two copies:
set sh_script to "
cd ~/Desktop
dd if=source.img of=/dev/rdisk1 bs=1m
dd if=source.img of=/dev/rdisk2 bs=1m
"
do shell script sh_script with administrator privileges
say "Copy done"
Of course, there are lots of underlying asumptions, and the shell script part would probably need to be enhanced (error checking).
You could have a look at:
https://developer.apple.com/library/mac/technotes/tn2065/_index.html
should you want to get a deeper understanding of how Applescript interacts with the execution of shell scripts.
HTH,
Axel
_______________________________________________
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