Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
This is an old thread, but it came up when I searched for a possible solution for an issue I am having.

What I do for AutoCAD dwg files (under windows xp) is go to Folder Options->File Types->DWG->Advanced->New

Then in Action I put a description, like Print 11x17 and under Application used to perform action it would be:

"c:\program files\autocad 2004\acad.exe" "%1" /nologo /b plot11x17.scr

So then for running a script on a txt file on right-click, you would put "perl -w" code.pl "%1" or whatever.

What it does may be irrelevant but it runs a script then closes. This means you can highlight many dwgs, right click and have 12 copies of autocad open, run a script, then close.

This brings me to a question I have.

If I run more than 3 autocads at a time it will take much longer than if I did each file individually which has prompted me to attempt to put together this dal right here (note, I am very new at this so the code might look retarded):
#!perl -W use strict; die "Need Arguments." unless @ARGV; my $CADPath = join "", "\"", "c:/program files/autocad 2004/acad.exe", + "\" "; my $ScriptType = "hp5000"; foreach my $file (@ARGV) { if (-e $file) { my $RunIT = join "", $CADPath, $file, " /nologo /b ", $ScriptType; my $status = system($RunIT); die "$RunIT exited funny: $?" unless $status == 0; } }
This does exactly what I need to do, which is make a kind of queue. But how an I arrange it so I can highlight 20 file of only the dwgs I want and have it achieve the same thing without having to type in all the file names on the command line or make a batch file.

I thought about doing the folder thing, where it would process all the dwgs in a folder, but this is not what I want. There will be drawings in the folder I do not want to run.

Thanks


In reply to Re^2: (Not Quite Perl) Running Scripts from Right-Click Context Menu in Windows by five-ohm
in thread (Not Quite Perl) Running Scripts from Right-Click Context Menu in Windows by svsingh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (5)
    As of 2014-09-02 03:13 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite cookbook is:










      Results (18 votes), past polls