Wes Posted November 4, 2013 Share Posted November 4, 2013 (edited) How exactly can an applescript find it's own workflow folder? I tried: set workflowFolder to do shell script "pwd" but this just returns "/" I need my workflow folder to access files via applescript. Edited November 4, 2013 by wesleyh Link to comment
jdfwarrior Posted November 4, 2013 Share Posted November 4, 2013 Does the AppleScript reside in the workflow directory? If so, a quick google seems to indicate that this would work. set path to (path to me as string) Link to comment
Wes Posted November 4, 2013 Author Share Posted November 4, 2013 Thanks for your reply. That seems to return the path to Alfred.app - what I need is the path to the director you get when you right click on a workflow in alfred preferences and show choose in finder ("user.workflow.xxx") - I need to access files from that directory in my applescript. Link to comment
Wes Posted November 4, 2013 Author Share Posted November 4, 2013 Never mind, instead of using the NSApplescript action I needed to run a script action instead, so it's run in the background and not on the main thread. Thx! Link to comment
jdfwarrior Posted November 5, 2013 Share Posted November 5, 2013 Never mind, instead of using the NSApplescript action I needed to run a script action instead, so it's run in the background and not on the main thread. Thx! Great! Glad you got it worked out Link to comment
deanishe Posted April 30, 2016 Share Posted April 30, 2016 Does the AppleScript reside in the workflow directory? If so, a quick google seems to indicate that this would work. set path to (path to me as string) FYI, this only works if the script is in an actual file. If you've pasted your script in the Script box, then there isn't a file, so there can't be a path to it. Link to comment
shazoom Posted May 18, 2016 Share Posted May 18, 2016 (edited) You can runs a shell script to do it. To load an external Applescript library, for example,: global bt_lib set bt_lib_filename to "bt_lib.scpt" set pwd to (do shell script "pwd") set bt_lib to load script (pwd & "/" & bt_lib_filename) I got this from: https://github.com/qlassiqa/qworkflow Edited May 18, 2016 by shazoom Christin White 1 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