Files
SyncHome/trunk/ulp/run-loop-all-schematic-script.ulp

26 lines
852 B
Plaintext
Raw Permalink Normal View History

2023-03-09 10:24:21 +00:00
#usage "<b>run a SCRIPT through all schematics in a directory</b><p>\n"
"Load any schematic from the project directory and execute the SCRIPT.<p>"
"<author>Author: alf@cadsoft.de</author><p>"
string a[], cmd;
//-------- main program --------------------------------------------------
if (schematic) {
schematic(S) {
string sch_path = filedir(S.name);
string ScriptFile = dlgFileOpen("Select a SCRIPT to start in all Schematics", "", "*.scr");
if (!ScriptFile) exit(0);
int n = fileglob(a, sch_path + "*.sch");
if (n) {
for (int xl = 0; xl < n; xl++) {
string h;
sprintf(h, "EDIT '" + sch_path + filename(a[xl]) + "';\nSCRIPT '" + ScriptFile + "';\n");
cmd += h;
}
}
}
exit (cmd);
}
else dlgMessageBox("Start this ULP from a Schematic", "OK");