AutoHotkey Community

It is currently May 27th, 2012, 2:58 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Print Selected files
PostPosted: March 18th, 2010, 6:47 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 6:52 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Code:
Run print c:\Temp\test.txt

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 7:11 pm 
Offline

Joined: March 18th, 2010, 7:09 pm
Posts: 36
how would i incorporate that for all the selected files?

thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 7:31 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Selected where from?

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 7:33 pm 
Offline

Joined: March 18th, 2010, 7:09 pm
Posts: 36
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 7:53 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
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:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 7:56 pm 
Offline

Joined: March 18th, 2010, 7:09 pm
Posts: 36
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 :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:05 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:07 pm 
Offline

Joined: March 18th, 2010, 7:09 pm
Posts: 36
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:14 pm 
ok, that means u can use "Run print %A_LoopField%" to default print the file
back to the open file, ^p press enter method


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:15 pm 
can't*


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:31 pm 
Offline

Joined: March 18th, 2010, 7:09 pm
Posts: 36
But how do I open the file to issue the ^p

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

thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:42 pm 
Have you tried:
Code:
RunWait, print %currentPath%\%file%


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:51 pm 
Offline

Joined: March 18th, 2010, 7:09 pm
Posts: 36
Another Guest wrote:
Have you tried:
Code:
RunWait, print %currentPath%\%file%


just tried, same error..


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 3:09 am 
Offline

Joined: March 18th, 2010, 7:09 pm
Posts: 36
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], rbrtryn and 28 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group