Jump to content

[Request] Create New File in Finder


Recommended Posts

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
Link to post
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. 

 

Here's what I put together: http://d.pr/f/KbzM

 

Use the keyword "touch" followed by a filename to create that file in the frontmost Finder window. "touch add" allows you to store commonly-used filenames for later access through Alfred's new feedback system.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...