1
0
Fork 0
This repository has been archived on 2019-12-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
arduinisten/eagle-5.7.0/ulp/run-loop-all-lbr-script.ulp

28 lines
921 B
Text
Raw Normal View History

2010-03-30 20:14:34 +02:00
#usage "<b>run a SCRIPT through all libraries in a directory</b><p>\n"
"Load any library from the library directory and execute the SCRIPT.<p>"
"<author>Author: librarian@cadsoft.de</author><p><p>"
string a[], cmd;
//-------- main program --------------------------------------------------
if (library) {
library(L) {
string lbr_path = filedir(L.name);
string ScriptFile = dlgFileOpen("Select a SCRIPT to start in all LBRs", "", "*.scr");
if (!ScriptFile) exit(0); // 2006.02.20 librarian@cadsoft.de
int n = fileglob(a, lbr_path + "*.lbr");
if (n) {
for (int xl = 0; xl < n; xl++) {
string h;
sprintf(h, "OPEN '" + lbr_path + filename(a[xl]) + "';\nSCRIPT '" + ScriptFile + "';\n");
cmd += h;
}
}
}
exit (cmd);
}
else dlgMessageBox("Start this ULP from a Library", "OK");