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

Can't get Script Filter to find the pinboard.py file from the tutorial #179

Open
felciano opened this issue Nov 5, 2021 · 1 comment
Open

Comments

@felciano
Copy link

felciano commented Nov 5, 2021

I've been unable to replicate the pinboard example from the tutorial. The code runs fine when run from the command line, but when triggered via Alfred no list items show up. Per the debugger it looks like Alfred can't find the script:

[21:38:51.942] Logging Started...
[21:40:04.764] File namer[Snippet] Processing complete
[21:40:04.770] File namer[Snippet] Passing output '' to Script Filter
[21:40:04.788] File namer[Script Filter] Queuing argument '(null)'
[21:40:04.877] File namer[Script Filter] Script with argv '(null)' finished
[21:40:04.880] ERROR: File namer[Script Filter] Code 2: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'pinboard.py': [Errno 2] No such file or directory

This is when the Script Filter is configured with /bin/bash and

python pinboard.py

The script is located in the workflow directory, and if I pass in a complete pathname, it works.

Is there something special needed for the Script Filter to launch in the workflow directory and thus be able to use filenames relative to that directory?

@lisaross
Copy link

Hey @felciano I had this problem too, and when I went to https://pypi.org/project/Alfred-Workflow/ to dig deeper I saw the directory structure as it is meant to work:

Your Workflow/
    info.plist
    icon.png
    workflow/
        __init__.py
        background.py
        notify.py
        Notify.tgz
        update.py
        version
        web.py
        workflow.py
    yourscript.py
    etc.

I think the confusion in the instructions is "Your Workflow" top level folder vs the "workflow" folder from this project.

When the file is in the top level, it works.

The 'workflow' folder isn't something we are meant to change. It's a library we're able to reference in our Python ie:

from workflow import Workflow, web

So anything we write should stay in the root folder like the icon and the plist.

Fingers crossed that's right. Don't want to send everyone astray.

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