gustavok Posted November 16, 2016 Share Posted November 16, 2016 Hi, I made a simple an apple script to open a specific folder triggered by a hotkey, but it's not working and I can't find why. It works if I use the Script Editor from Mac OS but when I paste it inside the "Run NSAppleScript" window on Alfred it doesn't. Script: on alfred_script(q) property the_path : "/Users/UserXXX/Downloads" set the_folder to (POSIX file the_path) as alias tell application "Finder" activate if front Finder window exists then set target of front Finder window to the_folder else open the_folder end if end tell end alfred_script Link to comment
RodgerWW Posted November 18, 2016 Share Posted November 18, 2016 (edited) Just out of curiosity: Why not just have Alfred open the folder with the "Open File" action? In a new workflow: Add a Hotkey and set it to whatever you want. Add an "Open File" action and drag the folder you want to open into the left pane of the popup, where it says "Open the passed-in file(s)" then save Then, connect the hotkey to the open file action. Edited November 18, 2016 by RodgerWW Link to comment
gustavok Posted December 15, 2016 Author Share Posted December 15, 2016 On 11/18/2016 at 1:56 PM, RodgerWW said: Just out of curiosity: Why not just have Alfred open the folder with the "Open File" action? In a new workflow: Add a Hotkey and set it to whatever you want. Add an "Open File" action and drag the folder you want to open into the left pane of the popup, where it says "Open the passed-in file(s)" then save Then, connect the hotkey to the open file action. Thanks ! It works. I thought that the "open file" action only work with files and not folders. Anyway, I'm curios why the commands didn't work on that script. Link to comment
RodgerWW Posted December 15, 2016 Share Posted December 15, 2016 9 hours ago, gustavok said: Thanks ! It works. I thought that the "open file" action only work with files and not folders. Anyway, I'm curios why the commands didn't work on that script. Well, not sure why the "Run NSAppleScript" does NOT work, but: Change the "Run NSAppleScript" to a "Run Script" Action. Then in the script language, change to "/usr/bin/osascript (AS)". Then for the script, remove all text that is already there, and then place your script from above into the blank area. That works for me fine here. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now