home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2000 January / LCD_01_2000.iso / anwend / idealist / script / jinnplug / ilprint.sic < prev   
Encoding:
Text File  |  1999-12-01  |  1.7 KB  |  62 lines

  1. //////////////////////////////////////////////////
  2. // Plugin-Script für Jinnee
  3. // 
  4. // Funktion: Textdatei(en) ausdrucken mit IdeaList
  5. //////////////////////////////////////////////////
  6.  
  7. // JCtxtPlg|Group=extensions|Name=Drucken mit IdeaList|File=1|Folder=0|Folderlinks=0|Desktop=0|Directory=0|
  8. // |Match=*.txt,*.doc,*.dok,*.tex,*.sty,*.asc,*.man,liesmich.*,readme.*,read.me,*.htm,*.html,*.rtf,*.sic,*.stg|
  9. // |End
  10.  
  11. // Pfad von IdeaList aus ilplugin.inf lesen
  12. error = 1;
  13. cwd(inffile);
  14. inffile += "config\\";
  15. inffile += "ilplugin.inf";
  16. if (fopen(inffile, "r")) {
  17.    getline(inffile,idealistpath);
  18.    fclose(inffile);
  19.    error = (fsize(idealistpath) == -1);
  20.    }
  21.  
  22. // ilplugin.inf oder Pfad von IdeaList nicht gefunden -> Fileselector, Pfad in ilplugin.inf sichern
  23. if (error) {
  24.    cwd(idealistpath);
  25.    if (fsel(idealistpath,"Wo ist IDEALIST.PRG?","IDEALIST.PRG")) {
  26.       if (fopen(inffile, "w")) {
  27.          putline(inffile,idealistpath);
  28.          fclose(inffile);
  29.          }
  30.       }
  31.    }
  32.  
  33. cnfpath = path(idealistpath) + "ILPRINT.CNF";
  34.   
  35. if (jinnee.TestApp(basename(idealistpath))) {
  36. // IdeaList bereits aktiv -> Datei(en) übergeben und ausdrucken
  37.     if (fsize(cnfpath) != -1) {
  38.        idealist.LoadCNF(cnfpath);
  39.    }
  40.    if (argc > 0) {
  41.        for(i = 0; i < argc; i++) {
  42.          idealist.Open(argv[i]);
  43.          idealist.Print();
  44.        }
  45.    }
  46. }
  47. else {
  48. // IdeaList nicht aktiv -> Kommandozeile erstellen und IdeaList im Batch-Modus starten
  49.    if (argc > 0) {
  50.     cmd = argv[0];
  51.    for (i = 1; i < argc; i++) {
  52.           cmd += " " + argv[i];
  53.       }   
  54.       if (fsize(cnfpath) != -1) {    
  55.        cmd += " " + cnfpath;    
  56.       }
  57.     cmd += " -B";    
  58.    jinnee.Exec(idealistpath, cmd);
  59.    }
  60. }
  61.  
  62.