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

package info (click to toggle)
eagle 4.16-5
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 36,508 kB
  • sloc: sh: 82; makefile: 32
file content (27 lines) | stat: -rw-r--r-- 829 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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 LBRs", "", "*.scr");
      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");