Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Using Automator to launch Safari and webpages

First time user of Automator so forgive me for not using correct terms.

I've manage to create a workflow to open 3 pages. This was not easy to figure out. :)


First I open the safari windows and within that desktop I either ask Siri or use Spotlight to open the workflow I created and named. It opens the 3 webpages, but gives me a pop up window which I've attached.


I have Safari set to open with a blank Google page and Yahoo Finance pinned on the end. I removed the pinned tab and still had this pop up. I removed the open blank page with Google.com. It will open up 3 tabs and this pop up.


I'm using the latest update to Mojave.








MacBook Pro 13", macOS 10.14

Posted on Dec 19, 2019 3:33 AM

Reply

Similar questions

9 replies

Dec 19, 2019 8:08 PM in response to McKinney777

I was mistaken. You created an Application, not a Quick Action.

This shows that it is not a plain Workflow:

If you started with a plain Workflow, you converted it to an Application at some point.

An Application will take input and process that input. Your application will try to open whatever you pass to it with Safari, along with the web sites you entered.


A Quick Action will appear in the Services menu and in the ctrl-click contextual menu (if you select input it accepts).

An Application and a plain Workflow will not appear there.


When I double click on it, it launches, but it takes over on other Safari's open on other desktops. I generally have 3-4 Desktops set on the top of the screen.
How can I get it to open a new separate Safari first. When I open a separate Safari I do not know how to get the workflow to open within that Safari.

You are using Full Screen. I don't use it at all, so not sure exactly what it is you are seeing or how to fix it.


I'm not sure how to tell it to open a new browser window. You could run an AppleScript action and tell Safari to open a new document window, then run open web pages action which might open them in the new window. But, it might be easier to just do the whole thing with an AppleScript.


The answer to this question could be used for what you want. Just add more lines in the tell window 1 block.

Dec 20, 2019 6:54 PM in response to Barney-15E

Actually I don't really need open a new Safari window.

Playing around with this I've discovered that if I don't have any Safari windows open yet and I double click on the Automator icon I created, then Safari does launch and the 3 tabs load with the 3 websites.

If I already have a few Safari windows open on other desktops, I can open a new Safari window within a blank (as in no other Safari windows are already open) desktops and then click on the Automator icon on that desktop it will open Safari and open the 3 tabs. So, I feel like it's sorta doing exactly what I want.


I'd be in interested in the way to open multiple sites at the same time as you describe and I want them to open in tabs within the same browser. Let me know these ways if and when you get time, I'd be greatly appreciative.


This is the icon on my desktop that is doing what I described.



This is my desktop with multiple desktops that I described.




Dec 19, 2019 5:20 AM in response to McKinney777

You created a Quick Action which takes input and processes that input.

It should only get files and folders if your ctrl-click on one or a selection of them and select the Quick Action from the contextual menu. But, it could be that it is getting input when you invoke it using Siri or Spotlight.


Since you didn't want any input, you should have just created a plain workflow.

If you want it available in the Services menu or the contextual menu, you can set it for No Input instead of Files and Folders.

Dec 19, 2019 6:55 PM in response to Barney-15E

You created a Quick Action which takes input and processes that input.
It should only get files and folders if your ctrl-click on one or a selection of them and select the Quick Action from the contextual menu. But, it could be that it is getting input when you invoke it using Siri or Spotlight.

I have no idea what this means. I created a Workflow.


If you want it available in the Services menu or the contextual menu, you can set it for No Input instead of Files and Folders.

How do I set it to either of those?

I've set it to the desktop.


After some more reading about Automator and experimenting with building Workflows I've manage to get to stop with the pop up menu.

When I double click on it, it launches, but it takes over on other Safari's open on other desktops. I generally have 3-4 Desktops set on the top of the screen.

How can I get it to open a new separate Safari first. When I open a separate Safari I do not know how to get the workflow to open within that Safari.





Dec 20, 2019 2:10 AM in response to Barney-15E

This has turned into a clutter of comments I'm not able to follow along with in any sort of progressive action.

What ever I managed to create seems to open safari window and launch the 3 websites in 3 tabs. I'm ok with this. It was fun to try. Will it save me time? 10 seconds maybe, but I can't use to open a new Safari window.

The rest of what you wrote is over my head and I have no clue how to use an AppleScript.

I just wanted to try and learn how to use basic Automator.





Dec 20, 2019 10:42 AM in response to McKinney777

The part about wanting to open a new Safari window is not possible in Automator.


There are built-in ways to open multiple sites at the same time, but they will open in tabs within the same browser Window. I think there is a way to disable tabbed browsing (and documents in other apps), but I’m not at my Mac to explain where to find the settings

Dec 20, 2019 8:15 PM in response to McKinney777

I can't think of a way to make automator do it without using an AppleScript Action.

But since Automator offers nothing additional to this solution, you could just make it an AppleScript application.


Open Script Editor and paste in the following code. Edit the URLs and Add additional open location lines as needed.

tell application "Safari"
	make new document with properties {URL:"https://www.apple.com"}
	open location "support.apple.com"
end tell


Note that the URL property needs to be a full URL while the open location command can leave off the protocol.


You can save that as an application in Script Editor.


There is one thing you could do with Automator, though. If you wanted to create a shortcut for the app, you could make a Quick Action in Automator.

Set it to receive no input in any application.

Add a run AppleScript Action.

Replace the code in the action with the above code (edited as required).

Save that Quick Action, then go to the Keyboard System Preferences and create a custom shortcut for the Quick Action.


There is a bug that surfaces occasionally where the shortcut will not trigger until you select the Quick Action from the Services menu for the first time.

Dec 21, 2019 6:16 AM in response to Barney-15E

I've copy/pasted that script for future use.

For now, what I'm doing seems to work. I realize Automator can do far more than I will probably ever need, I don't seem to do very many repeated tasks where I would benefit from it.


Also, I'd maybe look into Hazel or Alfred if I were inclined or had a real need for what they're used for.


That last thing you mentioned looks like a good weekend mental challenge.

Using Automator to launch Safari and webpages

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.