Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: wf.local #2

Closed
fractaledmind opened this issue Mar 3, 2014 · 3 comments
Closed

Feature Request: wf.local #2

fractaledmind opened this issue Mar 3, 2014 · 3 comments

Comments

@fractaledmind
Copy link
Contributor

I think adding a method to access a workflow's root folder would prove handy. I know alp had this, and I use it a fair bit. Alongside wf.cache and wf.data, this would account for all 3 major workflow related folders. Of course, a corresponding method for wf.localfile(filename) would be helpful as well.

@deanishe
Copy link
Owner

deanishe commented Mar 3, 2014

It's something I've considered, but I wasn't sure about what it'd be used for. I ultimately decided against it because it'd just be os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__)), yourpath), or in a script it's a simple os.path.join(os.path.dirname(__file__), yourpath).

If it's a common thing, though, I'd be happy to add it.

What would you use such a feature for?

@fractaledmind
Copy link
Contributor Author

I use it when I pass variables from Python to Applescript. So there are 2 primary uses:

  • passing the POSIX path of the workflow icon to an AS dialog
  • passing the POSIX path of my _user-interactions.scpt helper script, which I use now to handle all of my AS-based UI elements.

In both cases, I use .format() string formatting to insert the paths, and the full os.path.join(os.path.dirname(__file__), yourpath) gets a bit unweildy, particularly when I am passing both the helper script and the icon to the same Applescript.

@deanishe
Copy link
Owner

deanishe commented Mar 3, 2014

Understood. I've added an workflowfile method that does exactly that.

I used localfile at first, but I thought workflowfile was a more descriptive name in the end.

As Workflow was already doing that to find info.plist, it might as well be factored out into a method anyone can use.

@deanishe deanishe closed this as completed Mar 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants