Jump to content

jierme

Member
  • Posts

    7
  • Joined

  • Last visited

Posts posted by jierme

  1. On 10/31/2022 at 5:47 AM, lutefish said:

    In case anyone is using this, the workflow needs updating to work with the Hook -> Hookmark rebranding. 

     

    Editing the script filter in the workflow and changing  

    to

     

    fixes it.

    It works! Thanks a lot.😀

  2. Luckily, I found a workflow(alfred-things workflow) that has successfully converted a list into JSON FORMAT and used it in a Script Filter just within AppleScript.

     

    That's part of his code:

    on add_item given title:_title, subtitle:_sub, arg:_arg, valid:_valid
    	set title to "{\"title\": \"" & _title & "\", "
    	set subtitle to "\"subtitle\": \"" & _sub & "\", "
    	set arg to "\"arg\": \"" & _arg & "\", "
    	set valid to "\"valid\": " & _valid & "}, "
    	set theItem to title & subtitle & arg & valid
    	set end of my _items to theItem
    	return my _items
    end add_item
    
    on to_json()
    	set json to "{\"items\": [" & text 1 thru -3 of (my _items as text) & "]}"
    	return json
    end to_json

     

    I tried to adjust his code for my use, and I found it works!

     

  3. On 3/10/2022 at 4:30 AM, Smpl said:

     

    Thanks, this works pretty well! However it only lets me select one of the 'results' from the script filter list either by pressing enter on it or the ⌘{number} keyboard shortcuts or by arrowing down then pressing enter. I'm not able to like start typing the name of the playlist

     

    Edit: Actually I think I got it; I checked "Alfred filters results" which seems to have fixed the not being able to type the playlist name. Not sure if that is the correct or only way to make that work.

     

     

    Have you found a way to convert the output of AppleScript to JSON format?

     

    Recently I wanted to write an Alfred Workflow to activate saved layouts (which were saved in the Moom app). The Moom app now only includes limited AppleScript support, and it does not support JavaScript. 

     

    I use the following commands to get a list of saved snapshots:

    tell application "Moom" 
        list of snapshots 
    end tell
    
    
    --> {"Scapple ‧ Microsoft Edge", "Microsoft Edge ‧ Alfred Preferences"}

     

    But I do not know how to convert this list into JSON FORMAT in AppleScript.

    Have you found a way to convert the output of AppleScript to JSON format?

    Or is there any method to deliver the list into the Script Filter in Alfred?

     

×
×
  • Create New...