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 Selected Text

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
SoggyDog



Joined: 02 May 2006
Posts: 214
Location: Greeley, CO

PostPosted: Thu Jun 05, 2008 10:18 pm    Post subject: Printing Selected Text Reply with quote

I had a need today for printing text from an application that, believe it or not, does not have the ability to print;
I'm sure similar scripts are out there, but thought I'd post it, just in case it fills a need for someone else.

Code:
; Print selected text to default printer

^!p::
SplashTextOn, 133, 23, Input Blocked...,Printing Selection
BlockInput, On
OldClip := Clipboard
Clipboard =
Send, {Ctrl Down}c{Ctrl Up}
FileDelete, %A_ScriptDir%\Clip2Print.txt
FileAppend, %Clipboard%, %A_ScriptDir%\Clip2Print.txt
Sleep, 3000
Run, Notepad.exe /P %A_ScriptDir%\Clip2Print.txt
Sleep, 3000
FileDelete, %A_ScriptDir%\Clip2Print.txt
Clipboard := OldClip
BlockInput, Off
SplashTextOff
Return

_________________

SoggyDog
Download AutoHotKey Wallpaper
Does 'Fuzzy Logic' tickle?
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions 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