File: run-loop-all-packages-script.ulp

package info (click to toggle)
eagle 5.10.0-2
  • links: PTS
  • area: non-free
  • in suites: squeeze
  • size: 88,616 kB
  • ctags: 720
  • sloc: makefile: 33; sh: 24
file content (21 lines) | stat: -rw-r--r-- 639 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#usage "<b>Run a SCRIPT through all symbols in a library</b><p>\n"
       "RUN run-loop-all-packages-script [SCRIPT]<br>"
       "<author>Author: librarian@cadsoft.de</author><p><p>"

string Version = "1.0";       // 2008-08-28
string ScriptFile = argv[1];
string cmd, s;

if  (library) {
  library(L) {
    if (!ScriptFile) ScriptFile = dlgFileOpen("Select a SCRIPT to run in all PACKAGES", path_scr[0], "*.scr");
    if (!ScriptFile) exit(0);
    L.packages(P) {
       sprintf(s, "EDIT %s.PAC;\nSCRIPT '%s';\n", P.name, ScriptFile);
       cmd += s;
    }
  }
  exit (cmd);
}

else dlgMessageBox("Start this ULP from a Library", "OK");