Jump to content

Run() vs Send()


 Share

Recommended Posts

I am attempting to do a command-line function. I had originally gotten it to work via Send() from the Start>Run since I couldn't get the Run() to work. Now, I have gotten the Run() to work... but it isn't the same.

What I am doing is printing a particular part# via user-input to a networked printer. The command-line is using Adobe Acrobat.

acrobat.exe /t <filename.pdf> <printername> <printerdriver> <port>

The problem is, when run from the Start>Run it does so without opening up Acrobat at all (seemless except for the Start>Run automation). Using the Run() version, it opens Acrobat in the background and prints it (luckily, without a dialog box). I just basically don't want acrobat to open up like normal (in fact, it opens the PDF).

Any suggestions on why there is a difference?

Note: I have tried MAXIMIZE, MINIMIZE and HIDE, the only 3 options. They don't pertain to this from what I can tell. It just shouldn't open up at all.

Edited by gnosis3d
Link to comment
Share on other sites

script excerpt? Our assumptions are about 80% inaccurate.

Lar.

I didn't want to post it due to alllll the variables. It gets mind-boggling.

Here you go:

Run('"' & @ProgramFilesDir & $acrobat & '"' & ' /t ' & '"' & $NTKSartworkDir & $partnum & '\' & $partnum & '.pdf' & '" "' & $printerName & '" "' & $printerDrv & '" ' & $printerIP, "", @SW_HIDE)

Send('"' & @ProgramFilesDir & $acrobat & '"' & '{SPACE}/t{SPACE}' & '"' & $NTKSartworkDir & $partnum & '\' & $partnum & '.pdf' & '"' & '{SPACE}' & '"' & $printerName & '"{SPACE}"' & $printerDrv & '"{SPACE}' & $printerIP & "{ENTER}")

Also, whatever that @Comspec command is, I never could get it to work. That may be the issue I am not seeing. This is an aspect of AutoIt I have never used.

Edited by gnosis3d
Link to comment
Share on other sites

Sure does.

INI File:

acrobat="\Adobe\Acrobat 5.0\Acrobat\acrobat.exe"

try doing a

ConsoleWrite(@crlf & @ProgramFilesDir & '\' & $acrobat & '"' & ' /t ' & '"' & $NTKSartworkDir & $partnum & '\' & $partnum & '.pdf' & '" "' & $printerName & '" "' & $printerDrv & '" ' & $printerIP & @crlf)

to verify the string being Run() is exactly what you want it to be. you've alot of double quotes in there and i think that one may be misplaced.

Link to comment
Share on other sites

try doing a

ConsoleWrite(@crlf & @ProgramFilesDir & '\' & $acrobat & '"' & ' /t ' & '"' & $NTKSartworkDir & $partnum & '\' & $partnum & '.pdf' & '" "' & $printerName & '" "' & $printerDrv & '" ' & $printerIP & @crlf)

to verify the string being Run() is exactly what you want it to be. you've alot of double quotes in there and i think that one may be misplaced.

...doesn't do anything. Is there an additional variable I need for it to output to a file?

And just to clarify (not being mean) but the Run() is an EXACT copy of the Send() except for the {SPACE} and {ENTER} commands. So I know it does work from a command-line. And like I said, it does WORK. I just don't know why it is opening Acrobat from Run() and not from Send(). They both "work", just the Run() shouldn't even have Acrobat open.

Link to comment
Share on other sites

...doesn't do anything. Is there an additional variable I need for it to output to a file?

And just to clarify (not being mean) but the Run() is an EXACT copy of the Send() except for the {SPACE} and {ENTER} commands. So I know it does work from a command-line. And like I said, it does WORK. I just don't know why it is opening Acrobat from Run() and not from Send(). They both "work", just the Run() shouldn't even have Acrobat open.

no worries on my thinking you're being mean or anything, seriously. i'm just bored at work and trying to help. If you're using SciTE editor (which you should check out on the download page if you're not), there is an output pane at the bottom that you can write to with ConsoleWrite(). i use that for alot of quick debugging when i don't want to have msgbox's popping up during execution.
Link to comment
Share on other sites

put this before the Run() and post the screenshot to us...

MsgBox(4096,'','"' & @ProgramFilesDir & $acrobat & '"' & ' /t ' & '"' & $NTKSartworkDir & $partnum & '\' & $partnum & '.pdf' & '" "' & $printerName & '" "' & $printerDrv & '" ' & $printerIP))

Lar.

http://www.wintergray.com/run_vs_send_01.jpg Edited by gnosis3d
Link to comment
Share on other sites

no worries on my thinking you're being mean or anything, seriously. i'm just bored at work and trying to help. If you're using SciTE editor (which you should check out on the download page if you're not), there is an output pane at the bottom that you can write to with ConsoleWrite(). i use that for alot of quick debugging when i don't want to have msgbox's popping up during execution.

SciTE = Da Shiznit

Didn't know about that tho. Will have to mess with it. Should save time. Thanks.

Link to comment
Share on other sites

should the /t switch be in the same set of quotes as the acrobat.exe?

So far it wasn't working with it inside. It is as if the Run() wants to know the .exe by itself, THEN all the command crap after it. *shrug* Lot of trial and error on this side ... :)

Link to comment
Share on other sites

So far it wasn't working with it inside. It is as if the Run() wants to know the .exe by itself, THEN all the command crap after it. *shrug* Lot of trial and error on this side ... :)

Typically when i Run() i've not had to do extra quotes etc, even with switches. Maybe i'm just fortunate in the programs that i run programatically.
Link to comment
Share on other sites

I will try again in the morning when I get back to work (pathing and all... can't do feasibly at home). I appreciate the help thus far, fellas.

:)

sometimes a night away from the computer is the best way to make progress on any program anyway. you'll get it to work, i'm sure.
Link to comment
Share on other sites

Kind of off topic, but while I have some ears attached to some brains listening...

I couldn't find any information (and I've dug a lot) about doing "mass copying".

A quick run-down of what my application is for at work... I pull files from a server, and use them to make materials. Right now I do it one at a time (it copies 2 files... one SMALL and one LARGE) for each part number.

I would prefer to insert a few part numbers at a time and have it copy them all just as if I dragged a bunch over. I can do everything else except for this task of copying many files as ONE SINGLE ACTION. Any ideas or something to get me going in the right direction?

Note: And yes, I have the online manual printed if I need to do some reading.

Edited by gnosis3d
Link to comment
Share on other sites

Kind of off topic, but while I have some ears attached to some brains listening...

I couldn't find any information (and I've dug a lot) about doing "mass copying".

A quick run-down of what my application is for at work... I pull files from a server, and use them to make materials. Right now I do it one at a time (it copies 2 files... one SMALL and one LARGE) for each part number.

I would prefer to insert a few part numbers at a time and have it copy them all just as if I dragged a bunch over. I can do everything else except for this task of copying many files as ONE SINGLE ACTION. Any ideas or something to get me going in the right direction?

Note: And yes, I have the online manual printed if I need to do some reading.

as with any programming solution, there are a lot of ways you could go. i made a script for our QA dept here, that prints of monitoring forms. they'll do a couple hundred in a day, and all of the old ones sit with the rest of the ones for the week, until they do their weekly reporting. the problem is, they have to print each one for the previous day the next day, to give out to the supervisors. so i just did a little script that printed everything that wasn't created the same day, and it creates a list as it prints. when it's run again it checks each file in the directory to see if it's in the list of ones that've already been printed. if not, then it prints it and adds it to the list.... it seems like you could do the same thing, or you could make a gui where you select which files you want copied, etc.
Link to comment
Share on other sites

as with any programming solution...

Absolutely. That's the kind of automation that is key in tedious work environments.

Each "copy" is done separately. I can't for the life of me find a copy command (or example of script to go off of) that would copy a list of things. I've got the rest of it finalized in a separate version. Section to type in a multitude of part numbers, with a check-system to see if there is any information in them before it uses the data. I just want a single seamless mass copy, rather than copy... copy... copy...

I have other people doing this process that aren't technically-savy and don't want them messing around cause they think the progress bar is done... when it really isn't done.

Edited by gnosis3d
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...