From 2c43762b36dadf4a1bf24efff8d1a0ea19e54b67 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 23:47:18 -0800 Subject: [PATCH] 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. --- apps/vectorcraft-cli/src/main.rs | 4 +++- crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + crates/ui-egui/src/script_runs.rs | 9 ++++++--- crates/ui-egui/src/tests/scripts_menu.rs | 21 +++++++++++++++++++++ docs/mcp.md | 4 +++- 32 files changed, 61 insertions(+), 5 deletions(-) diff --git a/apps/vectorcraft-cli/src/main.rs b/apps/vectorcraft-cli/src/main.rs index 533074b9b5..09e898b2cf 100644 --- a/apps/vectorcraft-cli/src/main.rs +++ b/apps/vectorcraft-cli/src/main.rs @@ -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); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 8bcb952c63..038f2d5202 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -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… Друг скрипт… diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 16936c57cf..1a58a61708 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -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… diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 9c5b633a50..3c32c8ba57 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 82bc2d5fb6..4ed3478543 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 54f430fe98..6349480e27 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -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… diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 7786ab6c1f..0b51de1ba1 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 4dc97a67b5..53de3bac32 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -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 η εκτέλεση του σεναρίου δεν είναι πλέον διαθέσιμη diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 5a3b001197..13c451f657 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index b6aec2d644..9f9a2a66ee 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -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ä diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index e0bdcf7625..bec8831a3a 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index b72a77a4d6..f735c1fd95 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -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 એન્વાયર્નમેન્ટ વેરિએબલ સેટ હોય ત્યારે તે ટાઇટલ બાર પસંદ કરે છે. diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index f2cb9a0afe..91872f2807 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -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 स्क्रिप्ट का रन अब उपलब्ध नहीं है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index aa97447796..4cdebb6b6c 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 21908fda55..56c282c700 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -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… diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index d57067bbdc..30d3c17b9e 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 76f1a6404b..1d027fe166 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -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 スクリプトの実行は利用できなくなりました diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 7cb1972a56..dcaefd804f 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -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 სკრიპტის გაშვება აღარ არის ხელმისაწვდომი diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index f1087286ff..f3194761a7 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -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 스크립트 실행을 더 이상 사용할 수 없습니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 0860fc50c7..095b74c876 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -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… diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 3907186f99..90c5f96f7a 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 92faaa025b..8fc5caf929 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index cde0c8d12a..28e8d37183 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -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 выполнение скрипта больше недоступно diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 90bedf9d78..9f9f6601b1 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 08940138fc..0388a17783 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index d3eff0fced..60f7356d36 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -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 виконання скрипта більше не доступне diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 749c0ff9de..d1cd5382c6 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 9658c0d9e6..b9db272073 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -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 脚本运行已不可用 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index a2410f6810..0b4184b239 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -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 指令碼執行已無法使用 diff --git a/crates/ui-egui/src/script_runs.rs b/crates/ui-egui/src/script_runs.rs index ab125bf44f..907bbdb9bc 100644 --- a/crates/ui-egui/src/script_runs.rs +++ b/crates/ui-egui/src/script_runs.rs @@ -91,13 +91,16 @@ pub(crate) fn run_chosen(app: &mut VectorcraftApp, params: Value) -> Result app.status("The Startup Scripts folder cannot be read"), + Ok(_) => {} + Err(e) => app.status(e), } } diff --git a/crates/ui-egui/src/tests/scripts_menu.rs b/crates/ui-egui/src/tests/scripts_menu.rs index f7fb97f11d..c1f418e62b 100644 --- a/crates/ui-egui/src/tests/scripts_menu.rs +++ b/crates/ui-egui/src/tests/scripts_menu.rs @@ -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"); diff --git a/docs/mcp.md b/docs/mcp.md index 56a8b782be..6f81dbb3f7 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -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