In Alfred v1, I had a simple AppleScript that created a new file in Finder's frontmost window:
tell application "Finder" to make new file at (the target of the front window) as alias
I'm trying to get it to work in Alfred v2 and I simply can't. I also tried alternatives, like this one, which uses Bash instead (from Mac Tuts), but nothing successful:
myPath=$(osascript -e 'try' -e 'tell application "Finder"' -e 'set this_folder to (the target of the front window) as alias' -e 'set this_folder to POSIX path of this_folder' -e 'return this_folder' -e 'end tell' -e 'end try' -e 'set this_folder to POSIX path of (path to desktop)' -e 'return this_folder');
cd $myPath;
touch newfile
Can someone point out what I'm doing wrong (or perhaps the Beta hasn't reached that point yet)? Also, if someone would like to lend a hand, all I want is a workflow that allows me to create a file. If you really want to have fun, an optional keyword argument which can specify the filename (and extension) would be even better.
Thanks in advance,
Bruno