Monday, September 30, 2013

bash script to backup compiled applescripts

#! /bin/bash

IFS=$(echo -en "\n\b")
for i in *.scpt
do
    osadecompile "$i" > "${i%.scpt}.applescript"
done
Here are some short scripts I use:
---- Clean Desktop.applescript
on run
    do shell script "chflags hidden ~/Desktop/*"
end run

---- Clutter Desktop.applescript
on run
    do shell script "chflags nohidden ~/Desktop/*"
end run

---- Eject and Sleep.applescript
tell application "Finder" to eject (every disk whose ejectable is true)
tell application "Finder" to sleep

---- Skip Forward 30 Seconds.applescript
tell application "iTunes" to set player position to (player position + 30)

No comments: