PDA

View Full Version : Anyone wanna write me a quick AppleScript?




Benjamindaines
Dec 30, 2006, 10:25 PM
What I need it to do:

Start Terminal (hidden if you can)
run cp ~/Documents/Stuff/.VolumeIcon.icns /volumes/"Back Up"/
Have it relaunch Finder
Have it quit Terminal


Much Thanks!



HexMonkey
Dec 30, 2006, 10:47 PM
You can bypass Terminal altogether:

do shell script "cp ~/Documents/Stuff/.VolumeIcon.icns /volumes/\"Back Up\"/"
do shell script "killall Finder"

Benjamindaines
Dec 30, 2006, 10:57 PM
You can bypass Terminal altogether:

do shell script "cp ~/Documents/Stuff/.VolumeIcon.icns /volumes/\"Back Up\"/"
do shell script "killall Finder"

Awesome thanks! I hate coding :p

Soulstorm
Dec 31, 2006, 02:30 AM
Heh. You don't know what you're missing :D

crazzyeddie
Dec 31, 2006, 09:02 AM
AppleScript is not even close to coding. Its really not bad and uses mostly english. Its hard to get used to it at all.

Benjamindaines
Dec 31, 2006, 10:48 AM
AppleScript is not even close to coding. Its really not bad and uses mostly english. Its hard to get used to it at all.

Yes I know AS is easy compared to cocoa (I've looked over source code for various apps) but it's the fact that I don't know it and am too lazy to learn it for the few times I need it that makes it difficult for me ;)

ATG
Dec 31, 2006, 01:16 PM
AppleScript is not even close to coding. Its really not bad and uses mostly english. Its hard to get used to it at all.
It's actually not so bad once you get used to it. I'm in the process of adding scripting to my Cocoa app and obviously I had to learn AppleScript first.

But it's easy for me as a prior programmer. I do remember trying to learn it many years ago before I had even heard of C and it's lack of structure was really infuriating.

It's great for making small apps though if you don't want to go through the trouble of creating a whole Cocoa app.

[/OFFTOPIC]