Jump to content

heepie

Member
  • Posts

    7
  • Joined

  • Last visited

Everything posted by heepie

  1. OK. I'll develop on python2 env for every users. Thank!
  2. @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)? šŸ¤”
  3. Thank you! I solved the problem and correctly work! šŸ‘ Also, I studied the concept 'shebang'! Gooo :D
  4. Thank for your comment! 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??
  5. 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
  6. 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? šŸ˜­
  7. 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? šŸ˜­
×
×
  • Create New...