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

No longer works in macOS 12.3 #68

Open
notDavid opened this issue Mar 24, 2022 · 10 comments
Open

No longer works in macOS 12.3 #68

notDavid opened this issue Mar 24, 2022 · 10 comments

Comments

@notDavid
Copy link

Since Apple removed Python2... :'(

@notDavid
Copy link
Author

notDavid commented Mar 24, 2022

Fyi for anyone stumbling upon this, i got it to work after jumping through some hoops:

Great workflow by the way!

@notDavid
Copy link
Author

There's also an issue in the "import search" functionality here.

To work around it, you can comment out all the lines in lib/searchio/cmd/web.py from 119 to 142 (as a result, open browser windows will no longer be found.) Also delete web.pyc.

You can then just copy the search url you want to import to the clipboard instead.

The bug details/error message:
13:02:57 workflow.py:2055 DEBUG    ---------- Searchio! (2.0.1) ----------
13:02:57 workflow.py:1462 DEBUG    reading settings from /Users/david/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred-searchio/settings.json
13:02:57 workflow.py:2339 DEBUG    update check not due
13:02:57 cli.py:63 DEBUG    args={'--help': False,
 '--version': False,
 '<args>': [''],
 '<command>': 'web'}
execution error: Error: Error: Application can't be found. (-2700)
13:02:57 workflow.py:2074 ERROR    Command '['/usr/bin/osascript', '-l', 'JavaScript', '-e', '\nfunction run(argv) {\n    var apps = {};\n    argv.forEach(function(name) {\n        if (Application(name).running()) {\n            apps[name] = true;\n        } else {\n            apps[name] = false;\n        }\n    });\n    return JSON.stringify(apps);\n}\n', 'Google Chrome', 'Safari']' returned non-zero exit status 1
Traceback (most recent call last):
  File "/Users/david/Alfred.alfredpreferences/workflows/user.workflow.71B242C7-E9EC-4031-B192-5E5A39D09BBD/lib/workflow/workflow.py", line 2067, in run
    func(self)
  File "/Users/david/Alfred.alfredpreferences/workflows/user.workflow.71B242C7-E9EC-4031-B192-5E5A39D09BBD/lib/searchio/cli.py", line 127, in cli
    return run(wf, argv)
  File "/Users/david/Alfred.alfredpreferences/workflows/user.workflow.71B242C7-E9EC-4031-B192-5E5A39D09BBD/lib/searchio/cmd/web.py", line 212, in run
    return do_get_url(wf, args)
  File "/Users/david/Alfred.alfredpreferences/workflows/user.workflow.71B242C7-E9EC-4031-B192-5E5A39D09BBD/lib/searchio/cmd/web.py", line 122, in do_get_url
    output = subprocess.check_output(cmd)
  File "/Users/david/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['/usr/bin/osascript', '-l', 'JavaScript', '-e', '\nfunction run(argv) {\n    var apps = {};\n    argv.forEach(function(name) {\n        if (Application(name).running()) {\n            apps[name] = true;\n        } else {\n            apps[name] = false;\n        }\n    });\n    return JSON.stringify(apps);\n}\n', 'Google Chrome', 'Safari']' returned non-zero exit status 1
13:02:57 workflow.py:2076 INFO     for assistance, see: https://github.com/deanishe/alfred-searchio/issues
13:02:57 workflow.py:2097 DEBUG    ---------- finished in 0.046s ----------

@benbernard
Copy link

any chance you would throw up a fork with those changes?

@notDavid
Copy link
Author

notDavid commented May 7, 2022

Hi @benbernard , i haven't actually changed the source files in the repo, only the resulting workflow. I don't have enough knowledge/time to do that (easily) and build the whole thing.
Besides, it's just an ugly workaround, what needs to happen is someone who knows python needs to "update" the code to python3 (and I expect that would be relatively easy if python is your thing...)

Anyways, i've exported my workflow and you can fetch it here.. Hopefully it will work for you, i might have changed some keywords you need to change.
Hope that helps :-)

@kongpuishun
Copy link

Hello @notDavid . A problem I am facing (even with your workflow) is that it shows "no such file or directory", may I know how would you fix that? Thanks!
Screen Shot 2022-05-25 at 7 55 44 PM

@notDavid
Copy link
Author

@kongpuishun I'm not sure, i would try deleting ddg in the screenshot above, and then in Alfred type searchio to go to the Searchio settings and add new search engines.

@rishraj
Copy link

rishraj commented Jun 12, 2022

Hi @notDavid , I'm not able open the searchio setting for some reason. It disappears after I hit enter. The search is working fine for the previously added engines though. Any idea about how I should resolve this?
Screenshot 2022-06-12 at 4 25 55 PM
Screenshot 2022-06-12 at 4 26 06 PM

@notDavid
Copy link
Author

@rishraj I don't know... but you can try opening the Workflow in Alfred and toggling "Debug mode" and see what errors you get, and see if that helps you in solving it.

@Kingmtu
Copy link

Kingmtu commented Jun 22, 2022

[13:57:05.598] Logging Started...
[13:57:20.294] Searchio![Script Filter] Queuing argument ''
[13:57:21.030] Searchio![Script Filter] Script with argv '' finished
[13:57:21.033] ERROR: Searchio![Script Filter] Code 127: env: python: No such file or directory

@llity
Copy link

llity commented Jul 28, 2022

Need to be updated.

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

6 participants