I had a need to open a file to a specific offset (absolute position) via an external command. Mainly for an Alfred workflow I’m working on that leverages the Omnisearch API. I scratched my own itch and wrote this simple plugin:
Right now there are no settings, all it does is register the protocol handler obsidian://open-to-offset.
Would love any tips or critiques from the community before I attempt to submit this officially to the community plugin registry.
Also, I have been using your plugin and it works great. Do you think it would be possible to add an option to pass in a word and select that word from the offset? So if I pass in offset 10 and word “foo” then it would start at offset 10 look for the first instance of the word “foo” and highlight it.
That should be possible but I have been watching the Advanced URI repo and I saw that Vinzent added an open to offset function URI to his plugin (not published yet). I will see if I can make the feature you’re asking for but my goal for the plugin was just a temporary stopgap until Adv. URI supported it natively.
Advanced URI 1.42 was just released, supporting the new column parameter. But, I tested it and it’s relative to the line only. So for example in a 500-character note, passing ?column=410 won’t work.
I’ll work on seeing if I can enhance my plugin to support the feature you asked for @wayneh. Need to find some time.
Just updating this, Advanced URI does support an offset= param now which works well. I am still hoping a rainy day comes when I can add the “open from offset with selectioin” command.