Scripts: report an unreadable Startup Scripts folder at launch and attach it in the CLI

At launch, when Run Startup Scripts is on and the Startup Scripts folder is there but cannot be read, or a file is where the folder should be, the status bar says the folder cannot be read. The message does not carry the folder's path, so automation replies under read roots do not show it.

vectorcraft-cli attaches the same Startup Scripts folder for script.startup.run and never runs it on its own.
This commit is contained in:
dotCooCoo committed 2026-11-21 23:47:18 -08:00
1 parent d397f4232c
commit 2c43762b36
32 files changed
+61 -5

No files matched your search

+3 -1
View File
@@ -238,11 +238,13 @@ fn main() -> ExitCode {
/// A headless session that remembers what the user keeps between runs: the PDF presets saved, the
/// ICC profiles loaded, the plug-ins installed (#2168, #2174, #2541), the custom dictionary's words (#4936) and the Color Settings (#6335), in the folders
/// and files next to the preferences that the desktop app uses too, and lists the scripts of the Scripts folder there
/// (`script.listInstalled`), keeps each script's `Folder.userData` in the Script Data folder there, keeps File Info's
/// (`script.listInstalled`) and finds its Startup Scripts folder (`script.startup.run`, never run on its own), keeps each
/// script's `Folder.userData` in the Script Data folder there, keeps File Info's
/// metadata templates there and starts new documents from the New Document profiles there. `VECTORCRAFT_NO_PREFS` and
/// `VECTORCRAFT_CONFIG_DIR` apply as they do there.
fn with_stores(mut h: Headless) -> Headless {
prefs_dir::attach_scripts_dir(&mut h.session);
prefs_dir::attach_startup_scripts_dir(&mut h.session);
prefs_dir::attach_script_data(&mut h.session);
prefs_dir::attach_metadata_templates_dir(&mut h.session);
prefs_dir::attach_new_doc_profiles(&mut h.session);
+1
View File
@@ -2616,6 +2616,7 @@ font-technology Variable Променливи
Other Library… Друга библиотека…
Some scripts were not listed Някои скриптове не са изброени
The Scripts folder cannot be read Папката Scripts не може да бъде прочетена
@msg The Startup Scripts folder cannot be read Папката Startup Scripts не може да бъде прочетена
Loading scripts… Зареждане на скриптовете…
The Scripts folder is still being read Папката Scripts все още се чете
Other Script… Друг скрипт…
Can't render this file because it is too large.
+1
View File
@@ -64,6 +64,7 @@
Check Script Provjeri skriptu
Some scripts were not listed Neke skripte nisu navedene
The Scripts folder cannot be read Folder Scripts se ne može pročitati
@msg The Startup Scripts folder cannot be read Folder Startup Scripts se ne može pročitati
Loading scripts… Učitavanje skripti…
The Scripts folder is still being read Folder Scripts se još čita
Other Script… Druga skripta…
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -6441,6 +6441,7 @@ digits Malayalam Malaiàlam
@msg the script is no longer in the Scripts folder l'script ja no és a la carpeta Scripts
Some scripts were not listed Alguns scripts no s'han llistat
The Scripts folder cannot be read No es pot llegir la carpeta Scripts
@msg The Startup Scripts folder cannot be read No es pot llegir la carpeta Startup Scripts
Loading scripts… S’estan carregant els scripts…
The Scripts folder is still being read Encara s’està llegint la carpeta Scripts
@msg the script's run is no longer available l'execució de l'script ja no està disponible
Can't render this file because it is too large.
+1
View File
@@ -5249,6 +5249,7 @@ imageTrace Outline Obrys
@msg the script is no longer in the Scripts folder skript už není ve složce Scripts
Some scripts were not listed Některé skripty nebyly uvedeny
The Scripts folder cannot be read Složku Scripts nelze přečíst
@msg The Startup Scripts folder cannot be read Složku Startup Scripts nelze přečíst
Loading scripts… Načítání skriptů…
The Scripts folder is still being read Složka Scripts se stále načítá
@msg the script's run is no longer available běh skriptu již není k dispozici
Can't render this file because it is too large.
+1
View File
@@ -820,6 +820,7 @@ liquify-list-end {0}, {1} {0} og {1}
Check Script Kontrollér script
Some scripts were not listed Nogle scripter blev ikke vist
The Scripts folder cannot be read Mappen Scripts kan ikke læses
@msg The Startup Scripts folder cannot be read Mappen Startup Scripts kan ikke læses
Loading scripts… Indlæser scripter…
The Scripts folder is still being read Mappen Scripts læses stadig
Other Script… Andet script…
Can't render this file because it is too large.
+1
View File
@@ -4834,6 +4834,7 @@ theme Appearance Erscheinungsbild
@msg the script is no longer in the Scripts folder das Skript befindet sich nicht mehr im Ordner „Scripts“
Some scripts were not listed Einige Skripte wurden nicht aufgeführt
The Scripts folder cannot be read Der Ordner „Scripts“ kann nicht gelesen werden
@msg The Startup Scripts folder cannot be read Der Ordner „Startup Scripts“ kann nicht gelesen werden
Loading scripts… Skripte werden geladen…
The Scripts folder is still being read Der Ordner „Scripts“ wird noch gelesen
@msg the script's run is no longer available der Lauf des Skripts ist nicht mehr verfügbar
Can't render this file because it is too large.
+1
View File
@@ -2637,6 +2637,7 @@ axis Both Και τα δύο
@msg the script is no longer in the Scripts folder το σενάριο δεν βρίσκεται πλέον στον φάκελο Scripts
Some scripts were not listed Ορισμένα σενάρια δεν εμφανίζονται στη λίστα
The Scripts folder cannot be read Δεν είναι δυνατή η ανάγνωση του φακέλου Scripts
@msg The Startup Scripts folder cannot be read Δεν είναι δυνατή η ανάγνωση του φακέλου Startup Scripts
Loading scripts… Φόρτωση σεναρίων…
The Scripts folder is still being read Ο φάκελος Scripts διαβάζεται ακόμα
@msg the script's run is no longer available η εκτέλεση του σεναρίου δεν είναι πλέον διαθέσιμη
Can't render this file because it is too large.
+1
View File
@@ -4913,6 +4913,7 @@ axis Both Ambos
@msg the script is no longer in the Scripts folder el script ya no está en la carpeta Scripts
Some scripts were not listed Algunos scripts no se han incluido en la lista
The Scripts folder cannot be read No se puede leer la carpeta Scripts
@msg The Startup Scripts folder cannot be read No se puede leer la carpeta Startup Scripts
Loading scripts… Cargando scripts…
The Scripts folder is still being read Aún se está leyendo la carpeta Scripts
@msg the script's run is no longer available la ejecución del script ya no está disponible
Can't render this file because it is too large.
+1
View File
@@ -5154,6 +5154,7 @@ imageTrace Outline Ääriviiva
@msg the script is no longer in the Scripts folder komentosarja ei ole enää Scripts-kansiossa
Some scripts were not listed Kaikkia komentosarjoja ei ole lueteltu
The Scripts folder cannot be read Scripts-kansiota ei voi lukea
@msg The Startup Scripts folder cannot be read Startup Scripts -kansiota ei voi lukea
Loading scripts… Ladataan komentosarjoja…
The Scripts folder is still being read Scripts-kansiota luetaan vielä
@msg the script's run is no longer available komentosarjan suoritus ei ole enää käytettävissä
Can't render this file because it is too large.
+1
View File
@@ -4895,6 +4895,7 @@ axis Both Les deux
@msg the script is no longer in the Scripts folder le script ne se trouve plus dans le dossier Scripts
Some scripts were not listed Certains scripts ne sont pas répertoriés
The Scripts folder cannot be read Impossible de lire le dossier Scripts
@msg The Startup Scripts folder cannot be read Impossible de lire le dossier Startup Scripts
Loading scripts… Chargement des scripts…
The Scripts folder is still being read Le dossier Scripts est encore en cours de lecture
@msg the script's run is no longer available l’exécution du script n’est plus disponible
Can't render this file because it is too large.
+1
View File
@@ -4372,6 +4372,7 @@ arrowhead Feather પીંછું
Thai થાઈ
The Print Tiling tool placed the pages. પ્રિન્ટ ટાઇલિંગ ટૂલે પૃષ્ઠો ગોઠવ્યાં.
The Scripts folder cannot be read સ્ક્રિપ્ટ્સ ફોલ્ડર વાંચી શકાતું નથી
@msg The Startup Scripts folder cannot be read Startup Scripts ફોલ્ડર વાંચી શકાતું નથી
Loading scripts… સ્ક્રિપ્ટ લોડ થઈ રહી છે…
The Scripts folder is still being read સ્ક્રિપ્ટ્સ ફોલ્ડર હજી વંચાઈ રહ્યું છે
The VECTORCRAFT_TITLEBAR environment variable chooses the title bar while it is set. જ્યારે VECTORCRAFT_TITLEBAR એન્વાયર્નમેન્ટ વેરિએબલ સેટ હોય ત્યારે તે ટાઇટલ બાર પસંદ કરે છે.
Can't render this file because it contains an unexpected character in line 72 and column 5.
+1
View File
@@ -7587,6 +7587,7 @@ arrowhead Feather पंख
@msg the script is no longer in the Scripts folder स्क्रिप्ट अब Scripts फ़ोल्डर में नहीं है
Some scripts were not listed कुछ स्क्रिप्ट सूचीबद्ध नहीं की गईं
The Scripts folder cannot be read Scripts फ़ोल्डर पढ़ा नहीं जा सकता
@msg The Startup Scripts folder cannot be read Startup Scripts फ़ोल्डर पढ़ा नहीं जा सकता
Loading scripts… स्क्रिप्ट लोड हो रही हैं…
The Scripts folder is still being read Scripts फ़ोल्डर अभी भी पढ़ा जा रहा है
@msg the script's run is no longer available स्क्रिप्ट का रन अब उपलब्ध नहीं है
Can't render this file because it is too large.
+1
View File
@@ -5766,6 +5766,7 @@ imageTrace Outline Körvonal
@msg the script is no longer in the Scripts folder a parancsfájl már nincs a Scripts mappában
Some scripts were not listed Néhány szkript nem szerepel a listában
The Scripts folder cannot be read A Scripts mappa nem olvasható
@msg The Startup Scripts folder cannot be read A Startup Scripts mappa nem olvasható
Loading scripts… Szkriptek betöltése…
The Scripts folder is still being read A Scripts mappa olvasása még tart
@msg the script's run is no longer available a parancsfájl futása már nem érhető el
Can't render this file because it is too large.
+1
View File
@@ -695,6 +695,7 @@
Check Script Periksa skrip
Some scripts were not listed Beberapa skrip tidak dicantumkan
The Scripts folder cannot be read Folder Scripts tidak dapat dibaca
@msg The Startup Scripts folder cannot be read Folder Startup Scripts tidak dapat dibaca
Loading scripts… Memuat skrip…
The Scripts folder is still being read Folder Scripts masih dibaca
Other Script… Skrip lain…
Can't render this file because it is too large.
+1
View File
@@ -4972,6 +4972,7 @@ axis Both Entrambi
@msg the script is no longer in the Scripts folder lo script non è più nella cartella Scripts
Some scripts were not listed Alcuni script non sono stati elencati
The Scripts folder cannot be read Impossibile leggere la cartella Scripts
@msg The Startup Scripts folder cannot be read Impossibile leggere la cartella Startup Scripts
Loading scripts… Caricamento degli script…
The Scripts folder is still being read La cartella Scripts è ancora in lettura
@msg the script's run is no longer available l'esecuzione dello script non è più disponibile
Can't render this file because it is too large.
+1
View File
@@ -5798,6 +5798,7 @@ variable-list-end {0}, {1} {0}、{1}
@msg the script is no longer in the Scripts folder スクリプトは Scripts フォルダーにもうありません
Some scripts were not listed 一部のスクリプトは一覧に表示されていません
The Scripts folder cannot be read Scripts フォルダーを読み込めません
@msg The Startup Scripts folder cannot be read Startup Scripts フォルダーを読み込めません
Loading scripts… スクリプトを読み込み中…
The Scripts folder is still being read Scripts フォルダーをまだ読み込んでいます
@msg the script's run is no longer available スクリプトの実行は利用できなくなりました
Can't render this file because it is too large.
+1
View File
@@ -8467,6 +8467,7 @@ imageTrace Outline კონტური
@msg the script is no longer in the Scripts folder სკრიპტი აღარ არის Scripts საქაღალდეში
Some scripts were not listed ზოგიერთი სკრიპტი არ არის ჩამოთვლილი
The Scripts folder cannot be read Scripts საქაღალდის წაკითხვა შეუძლებელია
@msg The Startup Scripts folder cannot be read Startup Scripts საქაღალდის წაკითხვა შეუძლებელია
Loading scripts… სკრიპტების ჩატვირთვა…
The Scripts folder is still being read Scripts საქაღალდე ჯერ კიდევ იკითხება
@msg the script's run is no longer available სკრიპტის გაშვება აღარ არის ხელმისაწვდომი
Can't render this file because it is too large.
+1
View File
@@ -5727,6 +5727,7 @@ variable-list-end {0}, {1} {0} 및 {1}
@msg the script is no longer in the Scripts folder 스크립트가 더 이상 Scripts 폴더에 없습니다
Some scripts were not listed 일부 스크립트가 나열되지 않았습니다
The Scripts folder cannot be read Scripts 폴더를 읽을 수 없습니다
@msg The Startup Scripts folder cannot be read Startup Scripts 폴더를 읽을 수 없습니다
Loading scripts… 스크립트 불러오는 중…
The Scripts folder is still being read Scripts 폴더를 아직 읽는 중입니다
@msg the script's run is no longer available 스크립트 실행을 더 이상 사용할 수 없습니다
Can't render this file because it is too large.
+1
View File
@@ -665,6 +665,7 @@ liquify-list-end {0}, {1} {0} en {1}
Check Script Script controleren
Some scripts were not listed Sommige scripts zijn niet weergegeven
The Scripts folder cannot be read De map Scripts kan niet worden gelezen
@msg The Startup Scripts folder cannot be read De map Startup Scripts kan niet worden gelezen
Loading scripts… Scripts laden…
The Scripts folder is still being read De map Scripts wordt nog gelezen
Other Script… Ander script…
Can't render this file because it is too large.
+1
View File
@@ -5077,6 +5077,7 @@ imageTrace Outline Kontur
@msg the script is no longer in the Scripts folder skryptu nie ma już w folderze Scripts
Some scripts were not listed Niektóre skrypty nie zostały wyświetlone
The Scripts folder cannot be read Nie można odczytać folderu Scripts
@msg The Startup Scripts folder cannot be read Nie można odczytać folderu Startup Scripts
Loading scripts… Wczytywanie skryptów…
The Scripts folder is still being read Folder Scripts jest nadal odczytywany
@msg the script's run is no longer available uruchomienie skryptu nie jest już dostępne
Can't render this file because it is too large.
+1
View File
@@ -6116,6 +6116,7 @@ variable-list-end {0}, {1} {0} e {1}
@msg the script is no longer in the Scripts folder o script não está mais na pasta Scripts
Some scripts were not listed Alguns scripts não foram listados
The Scripts folder cannot be read Não é possível ler a pasta Scripts
@msg The Startup Scripts folder cannot be read Não é possível ler a pasta Startup Scripts
Loading scripts… Carregando scripts…
The Scripts folder is still being read A pasta Scripts ainda está sendo lida
@msg the script's run is no longer available a execução do script não está mais disponível
Can't render this file because it is too large.
+1
View File
@@ -4948,6 +4948,7 @@ axis Both Оба
@msg the script is no longer in the Scripts folder скрипт больше не находится в папке Scripts
Some scripts were not listed Некоторые сценарии не показаны
The Scripts folder cannot be read Не удалось прочитать папку Scripts
@msg The Startup Scripts folder cannot be read Не удалось прочитать папку Startup Scripts
Loading scripts… Загрузка сценариев…
The Scripts folder is still being read Папка Scripts ещё читается
@msg the script's run is no longer available выполнение скрипта больше недоступно
Can't render this file because it is too large.
+1
View File
@@ -4810,6 +4810,7 @@ axis Both Båda
@msg the script is no longer in the Scripts folder skriptet finns inte längre i mappen Scripts
Some scripts were not listed Vissa skript visas inte i listan
The Scripts folder cannot be read Mappen Scripts kan inte läsas
@msg The Startup Scripts folder cannot be read Mappen Startup Scripts kan inte läsas
Loading scripts… Läser in skript…
The Scripts folder is still being read Mappen Scripts läses fortfarande
@msg the script's run is no longer available skriptets körning är inte längre tillgänglig
Can't render this file because it is too large.
+1
View File
@@ -4670,6 +4670,7 @@ axis Both Her İkisi
@msg the script is no longer in the Scripts folder betik artık Scripts klasöründe değil
Some scripts were not listed Bazı komut dosyaları listelenmedi
The Scripts folder cannot be read Scripts klasörü okunamıyor
@msg The Startup Scripts folder cannot be read Startup Scripts klasörü okunamıyor
Loading scripts… Betikler yükleniyor…
The Scripts folder is still being read Scripts klasörü hâlâ okunuyor
@msg the script's run is no longer available betiğin çalıştırması artık kullanılamıyor
Can't render this file because it is too large.
+1
View File
@@ -4956,6 +4956,7 @@ axis Both Обидві
@msg the script is no longer in the Scripts folder скрипт більше не міститься в папці Scripts
Some scripts were not listed Деякі сценарії не показано
The Scripts folder cannot be read Не вдалося прочитати папку Scripts
@msg The Startup Scripts folder cannot be read Не вдалося прочитати папку Startup Scripts
Loading scripts… Завантаження сценаріїв…
The Scripts folder is still being read Папка Scripts ще читається
@msg the script's run is no longer available виконання скрипта більше не доступне
Can't render this file because it is too large.
+1
View File
@@ -5434,6 +5434,7 @@ theme Appearance Giao diện
@msg the script is no longer in the Scripts folder tập lệnh không còn trong thư mục Scripts
Some scripts were not listed Một số tập lệnh không được liệt kê
The Scripts folder cannot be read Không thể đọc thư mục Scripts
@msg The Startup Scripts folder cannot be read Không thể đọc thư mục Startup Scripts
Loading scripts… Đang tải tập lệnh…
The Scripts folder is still being read Thư mục Scripts vẫn đang được đọc
@msg the script's run is no longer available lần chạy tập lệnh không còn khả dụng
Can't render this file because it is too large.
+1
View File
@@ -5463,6 +5463,7 @@ imageTrace Outline 轮廓
@msg the script is no longer in the Scripts folder 脚本已不在 Scripts 文件夹中
Some scripts were not listed 部分脚本未列出
The Scripts folder cannot be read 无法读取 Scripts 文件夹
@msg The Startup Scripts folder cannot be read 无法读取 Startup Scripts 文件夹
Loading scripts… 正在载入脚本…
The Scripts folder is still being read 仍在读取 Scripts 文件夹
@msg the script's run is no longer available 脚本运行已不可用
Can't render this file because it is too large.
+1
View File
@@ -2808,6 +2808,7 @@ file-filter Templates 範本
@msg the script is no longer in the Scripts folder 指令碼已不在 Scripts 資料夾中
Some scripts were not listed 部分指令碼未列出
The Scripts folder cannot be read 無法讀取 Scripts 資料夾
@msg The Startup Scripts folder cannot be read 無法讀取 Startup Scripts 資料夾
Loading scripts… 正在載入指令碼…
The Scripts folder is still being read 仍在讀取 Scripts 資料夾
@msg the script's run is no longer available 指令碼執行已無法使用
Can't render this file because it is too large.
+6 -3
View File
@@ -91,13 +91,16 @@ pub(crate) fn run_chosen(app: &mut VectorcraftApp, params: Value) -> Result<Valu
}
/// When the app has started, out of Safe Mode: the startup scripts run when General › Run Startup
/// Scripts is on (`script.startup.run`). A failure to start them shows in the status bar.
/// Scripts is on (`script.startup.run`). A failure to start them, or a Startup Scripts folder that
/// is there and cannot be read, shows in the status bar.
pub fn run_at_launch(app: &mut VectorcraftApp) {
if app.session.startup_skip().is_some() {
return;
}
if let Err(e) = app.run("script.startup.run", json!({"reason": "launch"})) {
app.status(e);
match app.run("script.startup.run", json!({"reason": "launch"})) {
Ok(reply) if reply["unreadable"] == true => app.status("The Startup Scripts folder cannot be read"),
Ok(_) => {}
Err(e) => app.status(e),
}
}
+21
View File
@@ -600,6 +600,27 @@ fn with_run_startup_scripts_on_other_script_and_the_launch_run_the_startup_scrip
let _ = std::fs::remove_dir_all(dir);
}
#[test]
fn a_startup_scripts_folder_that_cannot_be_read_shows_in_the_status_bar_at_launch_and_a_missing_one_does_not() {
let dir = folder("startup-unreadable");
let mut app = app(&dir);
app.run("prefs.set", json!({"key": "runStartupScripts", "value": true})).unwrap();
let startup = dir.join("Startup Scripts");
app.session.attach_startup_scripts_dir(startup.clone());
app.status("before");
script_runs::run_at_launch(&mut app);
assert_eq!(app.ui.status, "before", "a missing folder runs nothing and says nothing");
// A file where the folder should be cannot be listed.
std::fs::write(&startup, "not a folder").unwrap();
script_runs::run_at_launch(&mut app);
assert!(!app.session.script_running());
// The message names the folder without its path, which automation replies would show.
assert_eq!(app.ui.status, "The Startup Scripts folder cannot be read");
let de = crate::i18n::Lang::from_code("de").unwrap();
assert_eq!(crate::i18n::message(de, &app.ui.status), "Der Ordner „Startup Scripts“ kann nicht gelesen werden");
let _ = std::fs::remove_dir_all(dir);
}
#[test]
fn a_first_read_that_ends_without_a_listing_says_the_folder_cannot_be_read_and_the_next_read_tries_again() {
let dir = folder("lost");
+3 -1
View File
@@ -3174,7 +3174,8 @@ The rest of this section is VectorCraft's own rules:
- Only the folder's own `.jsx` files run, never its subfolders. Links, names that start with a dot, files Windows marks
hidden or system, names longer than 255 bytes and other file types are left out. A listing stops at 2,048 folder
entries, 512 scripts or 250 ms. A folder that is missing runs nothing.
entries, 512 scripts or 250 ms. A folder that is missing runs nothing. At launch, when the folder is there and cannot
be read, or a file is where the folder should be, the status bar says that the folder cannot be read.
- The scripts run one at a time, sorted by name without regard to case, then by name. Each runs as `script.run` runs a
file, with the same limits, and each that changes a document adds its own Run Script undo step. The chosen script
runs after the last of them.
@@ -3187,6 +3188,7 @@ The rest of this section is VectorCraft's own rules:
- Running the startup scripts is itself a `script.*` command, which a script cannot run, so a startup script cannot
start another round of them. `script.run` called from automation runs alone.
- The web build has no Startup Scripts folder, and neither has a run with `VECTORCRAFT_NO_PREFS` set.
`vectorcraft-cli` uses the same folder and runs it only through `script.startup.run`.
`script.startup.run {reason: launch|menu, then?, maxFuel?}` runs the folder now. `then` holds `script.run`'s
parameters for a script that runs after the startup scripts; `maxFuel` limits each startup script's instructions