![](http://content.invisioncic.com/r229491/set_resources_12/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
heepie
-
Posts
7 -
Joined
-
Last visited
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Posts posted by heepie
-
-
@deanishe, I have a question for 'shebang'.
If I execute my script by 'shebang' like '#!/usr/local/bin/python3', it's OK. because python3 is already installed on my env
But if python3 is NOT installed on other's env, my script can't be executed.
Is there the way to execute my script even if python3 is NOT installed (like JVM)? 🤔
-
Thank you!
I solved the problem and correctly work! 👍
QuoteYou need to add the correct shebang to your script.
Also, I studied the concept 'shebang'!
Gooo :D
-
Thank for your comment!
Quotebecause /usr/bin/python is the Python 2 interpreter.
is it possible to change python2 -> python3?? I couldn't find the solution 😭
I'm trying it by `External Script`. But I also faced the problem.
1. Alert popup
Reason: launch path not accessible The external script may not exist, or doesn't have execute (+x) permissions. Related Workflow Info... Name: 'Bookmarks' Folder:/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.4119C437-9471-463E-A5AE-BC7A9185EC4E
2. Debugger
Bookmarks[Script Filter] Queuing argument '(null)'
So I add 'chmod +x bookmark.py'. But it's not solved
Additionally, when I execute './bookmark.py', the error occur. but 'python bookmark.py' is OK.
Could you help me?? -
when I checked it by debugger, the cause is python3.
I developed it on python3. But Alfred just support python2, right?
Anyway, I solved the problem by replacing ‘dataclass’ to ‘namedtuble’.
It’s possible to use dataclass on python3 later
-
Hello, I’m developing bookmark workflow for the minor browser.
Now, I faced the problem.I’m pass Alfred Json by script filter.When I run my code by `python3`, I checked correct outputs like below:{ "items": [ { "arg": "https://www.alfredapp.com/help/workflows/inputs/script-filter/json/", "subtitle": "https://www.alfredapp.com/help/workflows/inputs/script-filter/json/", "title": "Script Filter JSON Format - Workflow Input Objects - Alfred Help and Support", "uid": "https://www.alfredapp.com/help/workflows/inputs/script-filter/json/", "valid": true } ] }
But I couldn’t show my result by Alfred.My code@dataclass class UrlItem: name: str url: str class EnhancedJSONEncoder(json.JSONEncoder): def default(self, o): if dataclasses.is_dataclass(o): return dataclasses.asdict(o) return super().default(o) # There is Parser class def main(): Parser.parseForJson(bookMarkPath) json.dump(dict(items=mapToAlfredJson()), sys.stdout, indent=2, sort_keys=True, cls=EnhancedJSONEncoder) return 0 def mapToAlfredJson(): alfredJsonList = [] for item in bookMarkList: alfredJsonList.append(dict( title=item.name, subtitle=item.url, arg=item.url, uid=item.url, valid=True, )) return alfredJsonList if __name__ == "__main__": code = main() sys.exit(code)
Can I get your help? 😭
-
Hello, I’m developing bookmark workflow for the minor browser.
Now, I faced the problem.I’m pass Alfred Json by script filter.When I run my code by `python3`, I checked correct outputs like below:{ "items": [ { "arg": "https://www.alfredapp.com/help/workflows/inputs/script-filter/json/", "subtitle": "https://www.alfredapp.com/help/workflows/inputs/script-filter/json/", "title": "Script Filter JSON Format - Workflow Input Objects - Alfred Help and Support", "uid": "https://www.alfredapp.com/help/workflows/inputs/script-filter/json/", "valid": true } ] }
But I couldn’t show my result by Alfred.My code@dataclass class UrlItem: name: str url: str class EnhancedJSONEncoder(json.JSONEncoder): def default(self, o): if dataclasses.is_dataclass(o): return dataclasses.asdict(o) return super().default(o) # There is Parser class def main(): Parser.parseForJson(bookMarkPath) json.dump(dict(items=mapToAlfredJson()), sys.stdout, indent=2, sort_keys=True, cls=EnhancedJSONEncoder) return 0 def mapToAlfredJson(): alfredJsonList = [] for item in bookMarkList: alfredJsonList.append(dict( title=item.name, subtitle=item.url, arg=item.url, uid=item.url, valid=True, )) return alfredJsonList if __name__ == "__main__": code = main() sys.exit(code)
Can I get your help? 😭
[SOLVED] Pass the result to Alfred by Script Filter
in Discussion & Help
Posted
OK. I'll develop on python2 env for every users. Thank!