create href to local file path specified by lfp scheme

after register hanlder for lfp, we need to construct the scheme url corresponding to local file path, the path consist on 2 key part, formated date in YYYY-MM-DD and bgm japanese name(jpn), this the user script the construct the path based existing info on the page

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
作者
oscardoudou
1日のインストール数
0
累計インストール数
0
評価
0 0 0
バージョン
0.1
作成日
2025/06/24
更新日
2025/06/24
大きさ
3.54KB
ライセンス
不明
対象サイト

This only works for mac. create href to local file. so you can redirect to a file by click a link in browser. This is only the browser side of the work, you will need a url scheme defined to handle the href to local file path conversion as well as file opening.

My solution:

  1. create a url scheme, eg. call it lfp(://). SwiftDefaultsApp can do this.
  2. delegate an applescript/app to handle the url scheme, you might need to grant this app automation/terminal access in settings/privacy.
  3. create a python script that open file based on href input , which would be invoked in applescript as shell script

your chrome might need to start with an extra parameter for this process to work: -user-data-dir="/Users/$(whoami)/Library/Application Support/Google/Chrome" --enable-logging --v=2 --disable-features=StandardCompliantNonSpecialSchemeURLParsing