File: run-loop-all-lbr-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 (27 lines) | stat: -rw-r--r-- 921 bytes parent folder | download | duplicates (4)
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 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");