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 

Print Selected files
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
joey3002
Guest





PostPosted: Thu Mar 18, 2010 5:47 pm    Post subject: Print Selected files Reply with quote

I am trying to automate something.

I have a need to print many files at once. I would like to select the files, and then using the program, print each one.

Code:

Loop, %selectedFiles%
{
          Run, %selectedFiles%
          WinWait, APPNAME ;<---Change this to the name of the window that you see using the AutoIt Windows Spy
          Send, ^p
          Sleep, 1000
          WinClose, APPNAME
}


Any help you can give me would be really appreciated.
thanks
Back to top
HotKeyIt



Joined: 18 Jun 2008
Posts: 4652
Location: AHK Forum

PostPosted: Thu Mar 18, 2010 5:52 pm    Post subject: Reply with quote

Code:
Run print c:\Temp\test.txt

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
joey3002



Joined: 18 Mar 2010
Posts: 36

PostPosted: Thu Mar 18, 2010 6:11 pm    Post subject: Reply with quote

how would i incorporate that for all the selected files?

thanks
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4652
Location: AHK Forum

PostPosted: Thu Mar 18, 2010 6:31 pm    Post subject: Reply with quote

Selected where from?
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
joey3002



Joined: 18 Mar 2010
Posts: 36

PostPosted: Thu Mar 18, 2010 6:33 pm    Post subject: Reply with quote

HotKeyIt wrote:
Selected where from?


Sorry.. from explorer in windows xp

here is what I have but its not working..

Code:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

^l::
  WinGetClass explorerClass, A
  ControlGetText currentPath, Edit1, ahk_class %explorerClass%
;  msgbox >%currentPath%<
  ControlGet, selectedFiles, List, Selected Col1, SysListView321,ahk_class %explorerClass%
  msgbox %selectedFiles%
  Loop, Parse, selectedFiles, `n  ; Rows are delimited by linefeeds (`n).
  {
;msgbox >%currentPath%\%file%<
;          Run, %A_LoopFileFullPath%
          Run, %currentPath%\%file%
   Run print %selectedFiles%
;          WinWait, EditPad Lite ;<---Change this to the name of the window that you see using the AutoIt Windows Spy
;          Send, ^p
          Sleep, 1000
}
return
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4652
Location: AHK Forum

PostPosted: Thu Mar 18, 2010 6:53 pm    Post subject: Reply with quote

Code:
Backup:=ClipboardAll
Clipboard=
Send ^c
ClipWait,0.2
List:=Clipboard
ClipBoard:=Backup
Loop,Parse,List,`n,`r
 Run print %A_LoopField%

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
joey3002



Joined: 18 Mar 2010
Posts: 36

PostPosted: Thu Mar 18, 2010 6:56 pm    Post subject: Reply with quote

HotKeyIt wrote:
Code:
Backup:=ClipboardAll
Clipboard=
Send ^c
ClipWait,0.2
List:=Clipboard
ClipBoard:=Backup
Loop,Parse,List,`n,`r
 Run print %A_LoopField%


that works for .txt files... however, for a specific extension .STL it says:
no application is associated with the specified file for this operation

but when i double click the .stl file, it opens right up..

thanks almost there Smile
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Mar 18, 2010 7:05 pm    Post subject: Reply with quote

Can ur STL file print without opening the file?
for example, txt and images can do this directly while Word doc need to open up first then print
Back to top
joey3002



Joined: 18 Mar 2010
Posts: 36

PostPosted: Thu Mar 18, 2010 7:07 pm    Post subject: Reply with quote

Anonymous wrote:
Can ur STL file print without opening the file?
for example, txt and images can do this directly while Word doc need to open up first then print


correct, I need to open them in the application. I cant right click and print.
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Mar 18, 2010 7:14 pm    Post subject: Reply with quote

ok, that means u can use "Run print %A_LoopField%" to default print the file
back to the open file, ^p press enter method
Back to top
Guest






PostPosted: Thu Mar 18, 2010 7:15 pm    Post subject: Reply with quote

can't*
Back to top
joey3002



Joined: 18 Mar 2010
Posts: 36

PostPosted: Thu Mar 18, 2010 7:31 pm    Post subject: Reply with quote

But how do I open the file to issue the ^p

say the program that i use is called, xyz.exe

thanks
Back to top
View user's profile Send private message
Another Guest
Guest





PostPosted: Thu Mar 18, 2010 7:42 pm    Post subject: Reply with quote

Have you tried:
Code:
RunWait, print %currentPath%\%file%
Back to top
joey3002



Joined: 18 Mar 2010
Posts: 36

PostPosted: Thu Mar 18, 2010 7:51 pm    Post subject: Reply with quote

Another Guest wrote:
Have you tried:
Code:
RunWait, print %currentPath%\%file%


just tried, same error..
Back to top
View user's profile Send private message
joey3002



Joined: 18 Mar 2010
Posts: 36

PostPosted: Fri Mar 19, 2010 2:09 am    Post subject: Reply with quote

joey3002 wrote:
Another Guest wrote:
Have you tried:
Code:
RunWait, print %currentPath%\%file%


just tried, same error..


can anyone help me? I guess I need to open the application, then issue the ^p?

thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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