SpencerD Posted August 7, 2023 Share Posted August 7, 2023 I use Obsidian (am still getting my arms around Shimmering Obsidian but have it installed) and I keep all my bookmarks in a folder in Obsidian. I wanted to search in Alfred for a bookmark then have a script that parses the file and pulls out the link (it's denoted consistently in Obsidian, and I can easily grep it out in bash). Then I'd want Alfred to open a browser with that link. Instead, I end up either opening the file in Obsidian (or, annoyingly, in VS Code, my default md file reader). I can't figure out how to insert an action after the file is found so that instead of opening the file it uses the file as input to run a script that outputs the URL that can then be input to a browser step. I couldn't find an example in this forum like this, but maybe I missed it. Appreciate any help in advance! Link to comment
Stephen_C Posted August 7, 2023 Share Posted August 7, 2023 Welcome to the forum. 3 minutes ago, SpencerD said: so that instead of opening the file it uses the file as input I may be able to help with that part but as to the remainder suspect you're a much better programmer than I am so will leave you to take it further, if I may! Take a look at the Automation Task Read File Contents (and see here for an introduction to Automation Tasks in case you're not already familiar with them). That, at least, should get you the file contents (and, of course, you can put them on the clipboard using the Copy to Clipboard action if you need to). Stephen Link to comment
SpencerD Posted August 8, 2023 Author Share Posted August 8, 2023 Thanks - will give it a shot and come back if I can't figure it out. Link to comment
SpencerD Posted August 8, 2023 Author Share Posted August 8, 2023 In case it helps someone in the future, I used the File Filter action with the Read File Contents automation and then Get Matching Lines automation, passed through a Replace action and then to the Open Browser action. Works like a charm -- thank you! Stephen_C 1 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