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

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

Autore
oscardoudou
Installazioni giornaliere
0
Installazioni totali
0
Valutazione
0 0 0
Versione
0.1
Creato il
24/06/2025
Aggiornato il
24/06/2025
Dimensione
3,54 KB
Licenza
Non disponibile
Applica a

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