Skip to content

Instantly share code, notes, and snippets.

@PiotrKrzyzek
Last active May 23, 2018 23:50
Show Gist options
  • Save PiotrKrzyzek/80b68bc1ea219c9c642b3068e835b422 to your computer and use it in GitHub Desktop.
Save PiotrKrzyzek/80b68bc1ea219c9c642b3068e835b422 to your computer and use it in GitHub Desktop.
Upon new file detected, run animation script for ckb_next pipe animation as a system notification for whatever event.
on adding folder items to this_folder after receiving added_items
try
repeat with nDec from 0 to 255
set nHex to do shell script "perl -e 'printf(\"FFFFFF%x\", " & nDec & ")'"
do shell script "echo " & nHex & " > /tmp/ckbpipe001"
delay 0.005
end repeat
delay 0.1
repeat with nDec from 0 to 255
set nHex to do shell script "perl -e 'printf(\"FFFFFF%x\", " & 255 - nDec & ")'"
do shell script "echo " & nHex & " > /tmp/ckbpipe001"
delay 0.005
end repeat
do shell script "echo FFFFFF00 > /tmp/ckbpipe001"
repeat with EachItem in added_items
tell application "Finder"
delete EachItem
end tell
end repeat
end try
end adding folder items to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment