Jump to content

Save 'ur URL


Recommended Posts

Save a selected URL to a text file (appending if the file exists)
 

Introduction
Sometimes when browsing you want to save a URL quickly for future reference without creating a bookmark in your browser. That is what this workflow does. For simplicity it uses a simple plain text file (which will be created for you if it doesn't already exist) to which saved URLs will be appended. You select the location folder for that file in the workflow configuration.

Usage
Using your Universal Action hotkey on a selected URL, select Save URL to links file from the list and press ⏎.

TheUA.thumb.png.e1b49363988402baa6644ef1f48297ae.png

You will then be prompted for a description of the URL (which may be a useful reminder). Type the description and press ⏎. If you wish you can leave the description blank by simply pressing ⏎.

Description.thumb.png.91e280da3b86ab7db6d93069d9e634b9.png
The result will be a text file (which you can open in your default text file editor—I'm using CotEditor here and added the "Saved links” heading manually when creating the file):

Result.thumb.png.0c7c7291fbaab981015909c8c880411a.png

 

Notes
1. In the workflow configuration you can choose the keyword you wish to use to open the Links.txt file.
2. If (quite understandably 😀) you loathe the sound effect you can, of course, mute it in the workflow configuration.

 

GitHub download link

 

Stephen

Link to comment

With grateful acknowledgement to @Acidham for the ideas I've released version 2.0 which:

  • enables you to choose markdown or plain text for the file where you save the links; and
  • when pressing ⌘ after typing the keyword to open the links file, allows you to replace the links file with an empty file (thus deleting previously saved links).

Stephen

Link to comment

Version 2.4 represents a significant re-write of the workflow so that:

  • The first time you run the workflow the relevant plain text or markdown file is created with the heading Saved URLs.
  • It is now obligatory to include a description of the URL when saving to a markdown Links file but that remains optional when saving to a plain text links file.
  • The ReadMe has been updated and expanded.
  • The grammar in a couple of the dlalog boxes has been improved.
  • I have added a warning when you choose to create a new Links file (potentially deleting any previously saved links).

Stephen

Link to comment
  • 2 weeks later...

Version 3.0 is a significant update and adds the ability to search a Links.txt file and open any found URL directly from Alfred. Note that ability does not currently extend to a  Links file saved in markdown format.

Configuration options
You can choose:

  • The keyword you wish to use to trigger a search of the Links.txt file.
  • Whether you wish the selected URL to open in your default browser or (if you use Firefox) in a Firefox private window.

Searching URLs in a Links.txt file
Simply type your search keyword and the relevant URLs will display in Alfred's window. (Note that the search is case insensitive.) Press ⏎ to display the selected URL in your chosen browser. Here is an example of the result when I have chosen the configuration option to open a URL in a Firefox private window:

SearchResult.thumb.png.3658dcc1c8d69e7ffe1a7f9ffc0b2fbc.png
You will be warned if:
- the Links.txt file does not exist; or
- your search term is not found.


Notes
1. I am indebted to @vitor for huge help with the script filter.
2. If anyone more skilled than I is interested in contributing amendments to the script filter to:

  • detect use of a markdown links file; and
  • grep for searched links within that file to extract the URLs

all help will be gratefully received and will be acknowledged!

 

Stephen

Link to comment

Although version 3.2 is a point release it contains one significant enhancement and a significant bug fix.

Version 3.1 (which was not released) extended to markdown Links files the ability to search for URLs and open a selected link (with thanks to @vitor for conducting me to a missing exit 😀).

This version also fixes an irritating and persistent bug which, when searching a Links file, on occasion led to Alfred showing default fallback searches as the search result.

Stephen

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...