Stephen_C Posted August 9 Share Posted August 9 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 ⏎. 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 ⏎. 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): 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 Vero 1 Link to comment
Stephen_C Posted August 9 Author Share Posted August 9 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 Acidham 1 Link to comment
Stephen_C Posted August 9 Author Share Posted August 9 …and with apologies for the plethora of releases, version 2.1 adds error trapping for occasions when files do not exist. I dislike silent failures. 😀 Stephen Link to comment
Stephen_C Posted August 10 Author Share Posted August 10 Version 2.2 corrects some carelessness in the conditional logic when opening or replacing the links file. Thanks to @Acidham for pointing it out. Stephen Link to comment
Stephen_C Posted August 11 Author Share Posted August 11 Version 2.3 improves creation of new links file (adding a heading) and expands the ReadMe to cover opening of a links file and creation of a new links file. Stephen Link to comment
Stephen_C Posted August 13 Author Share Posted August 13 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
Stephen_C Posted August 23 Author Share Posted August 23 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: 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
Stephen_C Posted August 27 Author Share Posted August 27 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now