Jump to content

AvantGardener

Member
  • Posts

    2
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    AvantGardener got a reaction from Diegobit in Run Browser Web Search in the Background   
    Howdy Fellow Alfred-itors!
     
    I've been trying to figure out how I could modify Alfred's awesome keyword / search engine feature to enable me to do a Google search in a new background tab—i.e., *without* automatically shifting from my current browser tab (or current application) to the new browser tab where the search opens, as Alfred does by default.  There were a few forum posts over the years from users seeking this feature—but none of them was satisfactorily answered… Ha, but since I managed to figure out a workaround riiiiiight before I was about to give up, I thought I'd pay it forward and post it here —> since perhaps there are other users who'd like to enable to this search-in-background feature.
     
    This workflow enables you to (1) search Google using Alfred while browsing in Safari in a new background tab—as well as (2) to stay in a different (i.e., non-Safari) app and run the Google search entirely in the background… which can be helpful if you're, say, poring over an Excel spreadsheet and you want to remember to Google search something later—but don't want your focus to get yanked away from your current work.
     
    It's a simple two-step workflow design:
     
     
     
    INPUTS = "Keyword" —> ACTIONS = "Run Script"
     
    NOTE:  You must select "/usr/bin/osacript (AS)" from the "Language" drop-down menu on the script action—and then select "with input as {query}" from the adjacent drop-down.
     
    Here is the Applescript to enter into the "Script" box:
    set myURL to "https://www.google.com/search?q={query}" tell application "Safari" tell front window make new tab at end of tabs with properties {URL:myURL} end tell end tell  
     
    And finally, here are screen-grabs of how I configured both workflow items:
     

     
      
     
     
    I hope someone out there finds this helpful!
     
    Cheers,
     
    —Michael
×
×
  • Create New...