AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Printing for a Kiosk

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Barry



Joined: 05 Sep 2007
Posts: 5

PostPosted: Wed Sep 05, 2007 11:58 pm    Post subject: Printing for a Kiosk Reply with quote

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
View user's profile Send private message Send e-mail
engunneer



Joined: 30 Aug 2005
Posts: 6856
Location: Pacific Northwest, US

PostPosted: Thu Sep 06, 2007 12:07 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ahklerner



Joined: 26 Jun 2006
Posts: 1249
Location: USA

PostPosted: Thu Sep 06, 2007 12:08 am    Post subject: Reply with quote

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
View user's profile Send private message
n00ge



Joined: 28 Sep 2007
Posts: 26

PostPosted: Tue Mar 04, 2008 9:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
silveredge78



Joined: 25 Jul 2006
Posts: 387
Location: Midwest, USA

PostPosted: Tue Mar 04, 2008 9:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
n00ge



Joined: 28 Sep 2007
Posts: 26

PostPosted: Tue Mar 04, 2008 10:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
silveredge78



Joined: 25 Jul 2006
Posts: 387
Location: Midwest, USA

PostPosted: Tue Mar 04, 2008 10:44 pm    Post subject: Reply with quote

Then I think a:

Code:
Reload

at the end would do it.
_________________
SilverEdge78
Back to top
View user's profile Send private message
Kiosk Guy
Guest





PostPosted: Wed Mar 05, 2008 1:50 pm    Post subject: Printer Script Reply with quote

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

PostPosted: Fri Mar 07, 2008 1:23 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group