 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Barry
Joined: 05 Sep 2007 Posts: 5
|
Posted: Wed Sep 05, 2007 11:58 pm Post subject: Printing for a Kiosk |
|
|
I'm working on a kiosk that will be sent via the web. I have a coupon printing function that I've created but I can't get by the Print Dialog box! I've tried several ahk scripts but nothing seems to work. Here is the last script I tried...
WinWait, Print,
IfWinNotActive, Print, , WinActivate, Print,
WinWaitActive, Print,
MouseClick, left, 337, 403
Could anyone help me with this, I would really appreciate it. My mind is about fried trying to work around this. The reason I want to bypass (or automatically press the Print button) is so that someone can't change the quantity and print a hundred coupons at once.
Thanks in advance for the help! |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6856 Location: Pacific Northwest, US
|
Posted: Thu Sep 06, 2007 12:07 am Post subject: |
|
|
instead of mouseclick, try Send, {enter} or similar.
is the window actually popping up?
what kind of document are you printing? you may be able to print directly with the Run command (search the Run page for "print")
Automated Nitpicking:
when posting code in the forum, please use code tags, like this:
| Code: |
[code]
;code goes here
[/code]
|
Among other things, it makes it monospaced, syntax colored (comments), easy to copy, smaller, and it preserves the whitespace. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1249 Location: USA
|
Posted: Thu Sep 06, 2007 12:08 am Post subject: |
|
|
| specifying absolute coordinates will definitely not work,(for a script that will be ran by a diverse group) IMO. You need to look at the controlclick command. |
|
| Back to top |
|
 |
n00ge
Joined: 28 Sep 2007 Posts: 26
|
Posted: Tue Mar 04, 2008 9:19 pm Post subject: |
|
|
I'm looking into running this script for a kiosk setup as well. Whenever I run the script, it ends as soon as I print. How do I make it so that each time I print, it resets and I don't have to restart the script.
Here's the code I'm running (based off the previous sample):
| Code: | #Persistent
WinWait, Print,
IfWinNotActive, Print, , WinActivate, Print,
WinWaitActive, Print,
Send, {enter}
return |
Last edited by n00ge on Tue Mar 04, 2008 10:00 pm; edited 1 time in total |
|
| Back to top |
|
 |
silveredge78
Joined: 25 Jul 2006 Posts: 387 Location: Midwest, USA
|
Posted: Tue Mar 04, 2008 9:49 pm Post subject: |
|
|
Not exactly sure how you want it to be existing, but you could just throw a Reload at the end of your script. It will then sit and wait till the Print dialog box pops up again. _________________ SilverEdge78 |
|
| Back to top |
|
 |
n00ge
Joined: 28 Sep 2007 Posts: 26
|
Posted: Tue Mar 04, 2008 10:02 pm Post subject: |
|
|
| Basically, each time a print dialog pops up, I'd like it to catch it (as it does the first time around) and press enter when it's active. |
|
| Back to top |
|
 |
silveredge78
Joined: 25 Jul 2006 Posts: 387 Location: Midwest, USA
|
Posted: Tue Mar 04, 2008 10:44 pm Post subject: |
|
|
Then I think a:
at the end would do it. _________________ SilverEdge78 |
|
| Back to top |
|
 |
Kiosk Guy Guest
|
Posted: Wed Mar 05, 2008 1:50 pm Post subject: Printer Script |
|
|
Here is the script I am currently using for multiple prints with success. Hope this helps you out.
| Code: |
Loop
{
WinWaitActive, Print, ,
{
Send, {Enter}
}
}
|
|
|
| Back to top |
|
 |
poo_noo
Joined: 08 Dec 2006 Posts: 129 Location: Sydney Australia
|
Posted: Fri Mar 07, 2008 1:23 am Post subject: |
|
|
Have you tried the Run option in combination with windows inbuilt print command ?
| Code: | | Run, print.exe /D:\\%myprinter% "C:\Program Files\AutoHotkey\quickrefguide.pdf",,Hide |
I use it to bypass print dialog boxes.
Regards
Paul O _________________ Paul O |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|