How to Open a Link or URL
Learn how to open a link or URL from a scheduled event.
You can create an event in Power Manager that automatically opens a link or URL.
The URL will open in the user’s default browser. This behaviour can be customised by passing additional arguments to the
open
command.
Creating a URL Opening Event
Let’s create an event that opens this web site in the active user’s web browser.
- Launch Power Manager.app
- Add a new event; select the menu item: File > New > New Event…
- Select the Schedule Assistant task Execute a command line tool on-demand.
- Within the Executable step, use the executable
open
to open your desired URL:- Set Executable to
/usr/bin/open
- Add a blank argument and edit the blank argument to be the URL to open. For this recipe, the URL is
https://www.dssw.co.uk
- To open multiple URLs, append additional arguments for each URL. Modern browsers will open a new tab for each URL.
- Set Executable to
- Continue to the Environment step; there is nothing to change in this step. It is important the command is executed as the Active User.
- Continue to the Constraints step; there is nothing to change in this step.
- Continue to the Why step. Name your event and add any notes you desire. The name will be seen by the user of the computer.
- Continue to the Confirm step.
- Add to confirm the creation of the new event.
The automatic link opening event has been created and is active. You should now test the event works as desired. Do this by triggering the event from the Power Manager status-menu bar:
Alternatively, the new event can be triggered from the Scheduler view:
- Power Manager.app > Scheduler (menu) > Show Scheduler
Specific Browser
To open the link is a specific browser, pass the browser’s bundle identifier with the -b
flag. To open a URL using Mozilla’s FireFox browser, the full open
command becomes:
/usr/bin/open -b org.mozilla.firefox https://www.dssw.co.uk
For the event, pass the following three arguments:
-b
org.mozilla.firefox
https://www.dssw.co.uk