Skip to content

Instantly share code, notes, and snippets.

@teddokano
Created January 19, 2015 13:19
Show Gist options
  • Save teddokano/33b688d383d0ba0323df to your computer and use it in GitHub Desktop.
Save teddokano/33b688d383d0ba0323df to your computer and use it in GitHub Desktop.
Yosemite file copier for HDK-based mbed
(*
* mbed executable copier for Yosemite
* 01-Nov-2014, tedd
*
* this program is distributed under Apache-2.0 license
* http://opensource.org/licenses/Apache-2.0
*)
on open newFile
set targetPath to "/Volumes/MBED/" -- target volume (last '/' added on 2015Jan15)
set action1 to "sudo mount -u -w -o sync " & targetPath & ";" -- re-mounting the mbed volume
set newFileName to POSIX path of newFile -- get the file name and path in POSIX format
set action2 to "cp -X " & newFileName & " " & targetPath -- copy command
set comm to action1 & action2 -- concatinate all commands in a string
do shell script comm password "" with administrator privileges -- execute all commands on a shell
end open
@teddokano
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment