Jump to content

heepie

Member
  • Posts

    7
  • Joined

  • Last visited

Posts posted by heepie

  1. Thank for your comment!

     

    Quote

    because /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??

  2. 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? 😭

  3. 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...