Jump to content

protonymus

Member
  • Posts

    14
  • Joined

  • Last visited

Posts posted by protonymus

  1. I'm not sure if I understand your post correctly. After installing the workflow, the file 'example_workflow.alfredworkflow' is no longer necessary and can be safely deleted from the Downloads folder (or moved to the trash). A simple workflow designed to empty the Downloads folder directly from Alfred workflows could also serve the purpose. I don't think there's an automated option, but perhaps someone else has more information.

  2. @vitor I like your example. If I may suggest a compact mdfind alternative:

    #!/usr/bin/env zsh
    
    # Perform mdfind search and populate jsonObjects array
    while IFS= read -r resultPath; do
        jsonObject='{
        "uid":"'$resultPath'",
        "icon":{"path":"'$resultPath'"},
        "arg":"'$resultPath'",
        "subtitle":"~'${resultPath/#$HOME/}'",
        "title":"'$(basename "$resultPath")'",
        "type":"file"
        }'
        jsonObjects+=("$jsonObject")
    done < <(mdfind "kMDItemContentType == 'com.adobe.pdf'" -onlyin ~) # Search PDF files only in home
    #done < <(mdfind "*" -onlyin ~ 2>/dev/null) # search all in home
    
    # Convert jsonObjects array to JSON
    JSON='{"items":['$(IFS=, ; echo "${jsonObjects[*]}")']}'
    
    # Output JSON
    echo "$JSON"

     

    @andy4222 & @vitor To achieve this, would one need to first populate the 'Grid View' with all files and then filter the results using a 'Search Field' of the 'Grid View'? 

  3. Hi Gerave,

     

    It seems that the issue stems from the absence of a 'jq' installation. I apologize for not mentioning that 'jq' is a prerequisite. In my setup, it was installed via Homebrew (or a Homebrew Formula), which I overlooked.

     

     Could you check if 'jq' is installed? Just type 'which jq' in a terminal window. If it's there, then please take a look at the debug output of Alfred.

×
×
  • Create New...