Skip to content

Instantly share code, notes, and snippets.

@brock
Last active December 21, 2015 15:59
Show Gist options
  • Save brock/6330683 to your computer and use it in GitHub Desktop.
Save brock/6330683 to your computer and use it in GitHub Desktop.
Two files: an applescript that runs a bash script when items are added to a folder. http://wp.me/p2mniA-3Q
#!/bin/bash
# copy this to ~/bin: cp open-starred-urls.sh ~/bin
# make executable: chmod +x ~/bin/open-starred-urls.sh
# http://wp.me/p2mniA-3Q
cd ~/Dropbox/IFTTT/Desktop
for file in *.txt; do
cat $file | xargs open
mv $file archive
done
(*
run bash script when files added
copy to ~/Library/Scripts/Folder Action Scripts:
cp run-bash-script-when-files-added.scpt ~/Library/Scripts/Folder\ Action\ Scripts/
http://wp.me/p2mniA-3Q
*)
on adding folder items to this_folder after receiving added_items
try
do shell script "~/bin/open-starred-urls.sh"
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