new Safari windows with specific URL on current workspace via Alfred

I’ve done some google search jobs for a simple operation

  • via Alfred
  • pop up new safari on current workspace, and make it front
  • (optional) if needed, open specific URL //currently this script valid for just 1 URL address.
  • (optional) in case of specific URL, no need of “http://”

 

Here is the .alfredworkflow file => dropbox link

 

so, here is the simple usage

  • to open up ‘blank’ page

Screenshot 2014-08-15 22.25.01

  • to open up ‘specific URL address’

Screenshot 2014-08-15 22.24.44

I’m totally new to apple script and customising scripts via alfredworkflow.

main code for open up new window was not that hard. but variable setting and argument was tricky to me.
after 1 hour search, figure out grammar about string and & operator rules.
they are using q literally for alfred query -> applescript variable.
they are using & for continuation of string.

so,

set theURL to “http://” & q

eureka !
This alfred script is easy to use with Dual Monitor setting, also with multiple Workspace.
(When you input URL address without with this workflows, it open up URL on the tap of lastly used safari windows)
(when safari windows is floating on workspace 1 while you are using workspace 2, this prevent workspace turn back to workspace 1 for new safari windows)

p.s. broken dropbox link repaired
Broken dropbox link repaired again (08/03/2016)

Could anyone tell me whether the script function well on MacOS Sierra ??
After the upgrade MacOS Sierra, it is not working properly for me
(possible to simple open up new safari windows, but not with optional URL address input
Other script based application like karabiner is not working either)

 

2 comments

    1. Revised the link!

      Could you tell me whether the script function well??
      After the upgrade MacOS Sierra, it is not working properly for me
      (possible to simple open up new safari windows, but not with optional URL address input)

Leave a Reply

Your email address will not be published. Required fields are marked *