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
จำนวนติดตั้งประจำวัน
0
จำนวนติดตั้งทั้งหมด
0
คะแนน
0 0 0
เวอร์ชัน
0.1
สร้างเมื่อ
24-06-2025
อัปเดตเมื่อ
24-06-2025
Size
3.54 กิโลไบต์
สัญญาอนุญาต
ไม่มี
ปรับใช้กับ

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