![]() The same instructions as above from apply, you only have to input the following two scripts instead. My solution is probably quite hacky and since most of it is trial & error plus googling, I am afraid I won’t be able to help out customizing this solution even further, but I thought I’d nevertheless share the small improvement I achieved. When outside an Obsidian vault, you can select and open multiple files at once (the original script is only able to open one file at a time).obsidian will still be opened with your chosen Text Editor instead of Obsidian (unsuccessfully) trying to open them. With a lot of trial and error, I achieved to successfully make minor improvements: I can’t confidently include solutions I found on the internet into my guide and distribute that code to other people’s machines. I know neither Objective-C language nor Apple’s APIs. Unfortunately I don’t develop for Apple platforms. And quick searching around the internet shows that apparently I need to use Objective-C bridge and call native Objective-C APIs from JavaScript ![]() Moreover, Apple’s half-assed (sorry, I can’t find a better adjective) implemetation of JavaScript for Automation doesn’t contain APIs that let’s me specify which encoding to use when reading a file. So I googled a bit and apparently the JXA API doesn’t use Unicode as a default encoding for reading files. To clarify: the path to the file you are trying to open can contain unicode characters and the app works fine, unless the path to the vault folder itself contains unicode characters. Unfortunately it won’t work with vaults if the path to vault folder contains quirky unicode characters. Ok, so I looked into this issue and it is indeed a limitation of app that we create.
0 Comments
Leave a Reply. |