Jump to content
Wes

Find workflow folder with applescript

Recommended Posts

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 by wesleyh

Share this post


Link to post

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. 

Share this post


Link to post

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!

Share this post


Link to post

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

Share this post


Link to post

 

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...