Build an automation that runs an AppleScript file to save the URL
and title of a webpage to apple notes instead of doing it manually.
About this task
Ensure that you have created or have access to an
AppleScript that can save the URL and title of a webpage to apple notes. You can review
the following sample instructions to create an AppleScript that can then be used to
build a macOS based automation:
- On your macOS device, open the Script editor
application.
- Create a document and name it as URL capture.
Note: Only the .applescript file format
is currently supported.
- In the script editor, enter the
script:
tell application "Safari"
set myname to name of document 1
set myurl to URL of document 1
end tell
tell application "Notes"
set body of note "inbox" to (get body of note "inbox" & myname & " " & myurl)
end tell
- Click the Play icon at the top.
A dialog box is
displayed with the URl and title of the current webpage that is
open.
You can now use the URL capture AppleScript to build a macOS based
automation.
Procedure
-
Create an automation.
-
On the left panel, click Automation.
-
Click .
-
Enter a name for the automation.
For this example, enter the automation name as
AutoURL.
-
Click Create and edit.
-
Use the Open
action to create and link a session to the URL capture
AppleScript.
-
In Automation, click the AutoURL to
open this automation in the editor.
-
Double-click or drag the Open
action from the AppleScript
package.
-
In the Session name field, enter a name for the
session that you are about to create.
-
In the AppleScript field, select
Import existing file and click .
Navigate to the location where you have saved the URL capture
AppleScript.
-
Use the Run
action to deploy the automation and run the URL capture
AppleScript in order to save the URL and title of a webpage.
-
Double-click or drag the Run
action from the AppleScript
package.
-
In the Session name field, enter the name that
you have provided in the Open
action.
-
In the Run with field, select Full
script.
-
After the AppleScript run completes, use the Close
action to terminate the session.
-
Double-click or drag the Close
action from the AppleScript
package.
-
In the Session name field, enter the name that
you have provided in the Open
action.
-
Click Save.
The AutoURL automation is now linked to the URL capture
AppleScript.
-
Click the Run option at the top to deploy the
automation.
Automation is deployed and the URL capture AppleScript is
executed that captures the URL and title of a webpage to apple
notes.