Easily generate a URL including a fragment identifier based on the website and text selected in Safari (MacOS).
On MacOS, move the Fragment Identifier.workflow
file to ~/Library/Services
for enabling the "Fragment Identifier" service in Safari.
- Select some text on a website.
- Right-click (or Control-click) on the selected text. Under the Services submenu, you should now see a new item named Fragment Identifier.
- Click Fragment Identifier.
- The current website's URL, appended with a fragment identifier for the selected text, will now be copied to your clipboard.
- Paste your new URL including the fragment identifier wherever you'd like! 🎉
Note
First-Time Users: Initial usage might prompt for permission to use "JavaScript via AppleScript". If you'd prefer not to accept this, consider substituting
set baseURL to do JavaScript "window.location.href" in front document
with
set baseURL to URL of front document
However, when replacing the latter, be aware that the resulting URL may start with "favorites://" if the website you're currently on is also mentioned in your "Favorites".