Jump to content

KennyBoy

Member
  • Posts

    2
  • Joined

  • Last visited

KennyBoy's Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. Thanks for the reply. So, here is the script, and I have placed in a Script Filter object. Any example I have found, typically uses a langauge (AppleScript, Ruby, Java) that I am not familiar with, but all of them seem to just out put the script results in JSON format and send them to another object (List Filter, Copy to Clipboard, etc). I'm sorry, I guess I'm just not grasping what I should do with the output at this point. Any pointers, would greatly be appreciated. this_match=$1 while read line do results+=("$line") done < <(sqlite3 /Users/storage/sqlite_databases/bookmark.sqlite "select b.title, a.url, a.title from moz_places a, moz_bookmarks b where a.id=b.fk AND b.title LIKE '%${this_match}%' OR a.title LIKE '%${this_match}%' order by a.url,a.title,b.title " | sed 's/|//2') echo '{"items": [' echo '{' for i in "${results[@]}" do IFS="|" read name url <<< "$i" echo '"title"': ${name}, echo '"arg"': ${url}, done echo '}' echo ']}' And here is the output {"items": [ { "title": Alfred Blog - Productivity Tips & Tricks and Alfred News, "arg": https://www.alfredapp.com/blog/, "title": Tips and Tricks - Alfred Blog, "arg": https://www.alfredapp.com/blog/category/tips-and-tricks/, "title": Five Quick Ways To Start New Time-Saving Habits With Alfred - Alfred Blog, "arg": https://www.alfredapp.com/blog/tips-and-tricks/5-quick-ways-to-get-into-new-time-saving-habits/, "title": 7 Workflow Tips for Alfred 3 - Alfred Blog, "arg": https://www.alfredapp.com/blog/tips-and-tricks/7-workflow-tips-for-alfred-3/, "title": Perform File Actions Easily from Alfred or Finder - Alfred Blog, "arg": https://www.alfredapp.com/blog/tips-and-tricks/file-actions-from-alfred-or-finder/, "title": Tutorial: Creating the Fastest Hotkey-Based Web Search - Alfred Blog, "arg": https://www.alfredapp.com/blog/tips-and-tricks/tutorial-fastest-hotkey-based-search/, } ]} Ken
  2. Hi, I'm trying to create a workflow that takes an Keyword argument, passes that argument to a script (as an input argument), and then uses that input argument to query an SQLlite databases for matches. The items in the database are a Title and URL of particular web pages I have saved over the years. I then want to display the results in Alfred so I can select the URL (List Filter?) and then launch Firefox to go to the URL selected. I have done simple keyword searches to bash scripts workflows in the past sucessfully so I have an idea how those work. I have the script working, testing from the command line and it actualy outputs the JSON format that I belive that Alfred wants. My question is, now what? :) Looking at the templates, they show examples of Script Filter objects going to a bash script. I think I want to do the reverse. The results from the script will be different each time, so I don't think a List FIlter object will work. So what I think the work flow should be: Keyword Search-> Bash Script -> Script Filter -> (Display Results) -> Launch Browser with Selection Do I have this right? Ken
×
×
  • Create New...