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 

SOLVED Auto-open app & paste screencap in 1 sequence

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



Joined: 16 Jun 2008
Posts: 45

PostPosted: Wed Jul 16, 2008 8:15 pm    Post subject: SOLVED Auto-open app & paste screencap in 1 sequence Reply with quote

I do alot of SnagIt regional screen captures during a day -
both images and text.

And it seems like I can do everything I need to do in humble Microsoft Paint -
small size/super-quick to open/text boxes/etc.

And such a minimalist interface that it just stays out of my way!

It's simpler & faster for my purposes than actually allowing the screencap
to open in Snagit & work on it there.

So, I thought I was reducing my exertion by making #V open Paint,
then a slight shift of the pinky for ^V to paste the screencap.

Now it occurs to me I could get it all done in 1 combo sequence,
but of course I haven't quite got it figured out yet - "Asks for Help" Very Happy

I'd prefer to keep the SnagIt screencap event separate from the event of:

"Open the application & paste there, in 1 sequence."

This is because, when I finally decide on the clipboard manager I want to use,
I'll want to accumulate different captures on a multiple clipboard,
then selectively paste to my chosen app, perhaps at random - not in sequence.

Here's what I've tried so far:

Code:

#V::   
Run C:\WINDOWS\system32\mspaint.exe, ,max
Send ^V
return


Code:

clipboard =  ; Start off empty to allow ClipWait to detect when the text has arrived.
Send ^c
ClipWait
#V::   
Run C:\WINDOWS\system32\mspaint.exe, ,max
Send ^V
return


I'd like to apply this same idea to text captures,
pasting it to Notepad or NoteTab Pro, etc. in 1 sequence.

My guess is that if this is written correctly,
then it still preserves the independence of the native Ctrl + C/V Copy/Paste functions, eh?

[ ps - as always, sorry for mangling code in this elegant app ! Wink ]
.


Last edited by geor on Thu Jul 17, 2008 10:53 pm; edited 2 times in total
Back to top
View user's profile Send private message
BoBo²
Guest





PostPosted: Thu Jul 17, 2008 1:21 pm    Post subject: Reply with quote

AFAIK you can use SnagIt from the command line to save the captured images directly into a file without any additional app, or even SnagIt itself needed to be open. But I might be wrong. Good luck. Cool
Back to top
geor



Joined: 16 Jun 2008
Posts: 45

PostPosted: Thu Jul 17, 2008 3:45 pm    Post subject: Reply with quote

@BoBo2 - Thanks for the idea, I'll look into that, & as I study TFM some more,
I'm sure I'll get some better ideas how to accomplish what I'm after Very Happy
Back to top
View user's profile Send private message
scottmattes



Joined: 21 May 2007
Posts: 61
Location: USA

PostPosted: Thu Jul 17, 2008 9:38 pm    Post subject: this is what I did Reply with quote

Code:

#p:: ; do screen print and paste it into paint
  Send, {PRINTSCREEN}
  Run mspaint
  WinWait, untitled - Paint,
  IfWinNotActive, untitled - Paint, , WinActivate, untitled - Paint,
  WinWaitActive, untitled - Paint,
  Send, {SHIFTDOWN}{INS}{SHIFTUP}{ENTER}
return

_________________
-------------
Scott Mattes
Back to top
View user's profile Send private message
geor



Joined: 16 Jun 2008
Posts: 45

PostPosted: Thu Jul 17, 2008 10:52 pm    Post subject: Reply with quote

@scottmattes - man this works beautifully w/ PrtSc,
and I'm grateful to have this tool now - Thx very much !

It's interesting as I play with it,
it will NOT paste just the Active screen/dialogue box if Alt+PrtSc is pressed.

So then, I thought to change the script by adding ! to the {PRINTSCREEN} function, & now it will do both - either/or :

1. Paste the entire screen if PrtScr is pressed,
even if a dialogue box is present on the screen --->
but does NOT have the focus !!

2. Paste just the Active screen/dialogue box if --->
the Active screen/dialogue box HAS focus, & Alt+PrtSc is pressed.

Code:
#p:: ; do screen print and paste it into paint
  Send, !{PRINTSCREEN}
  Run mspaint
  WinWait, untitled - Paint,
  IfWinNotActive, untitled - Paint, , WinActivate, untitled - Paint,
  WinWaitActive, untitled - Paint,
  Send, {SHIFTDOWN}{INS}{SHIFTUP}{ENTER}
return


..................................................

As I went to experiment with this some more,
I "discovered" Embarassed that SnagIT can be set up
to automatically pass captures through to any program ! Embarassed Embarassed

But I am learning alot by studying what you coded,
so Thank You very much again, my friend Very Happy

Each day I get Great Helps here,
I look forward to knowing enough to return the energy !

.
Back to top
View user's profile Send private message
scottmattes



Joined: 21 May 2007
Posts: 61
Location: USA

PostPosted: Fri Jul 18, 2008 1:50 pm    Post subject: Reply with quote

I'm glad that I could be of service.

Based on your thoughts, I have changed my hotkey to the following (use #printscreen instead of #p, save/restore all clipboard contents, added hotkey #!printscreen)

Code:

;------------------------------------
; Screen Print, Win+printscreen
;------------------------------------
#printscreen:: ; do screen print and paste it into paint
  clipboardall_save = %clipboardall%
  Send, {PRINTSCREEN}
  Run mspaint
  WinWait, untitled - Paint,
  IfWinNotActive, untitled - Paint, , WinActivate, untitled - Paint,
  WinWaitActive, untitled - Paint,
  Send, {SHIFTDOWN}{INS}{SHIFTUP}{ENTER}
  clipboard = %clipboardall_save%
return



;------------------------------------
; Screen Print, Win+alt+printscreen
;------------------------------------
#!printscreen:: ; do screen print and paste it into paint
  clipboardall_save = %clipboardall%
  Send, !{PRINTSCREEN}
  Run mspaint
  WinWait, untitled - Paint,
  IfWinNotActive, untitled - Paint, , WinActivate, untitled - Paint,
  WinWaitActive, untitled - Paint,
  Send, {SHIFTDOWN}{INS}{SHIFTUP}{ENTER}
  clipboard = %clipboardall_save%
return

_________________
-------------
Scott Mattes
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 678

PostPosted: Fri Jul 18, 2008 5:15 pm    Post subject: Reply with quote

i know this is solved already but i stumbled upon it and felt compelled to point out one of master seans fine scripts
http://www.autohotkey.com/forum/viewtopic.php?t=18146&start=0&postdays=0&postorder=asc
_________________
Read this
Com
Automate IE7 with Tabs
Back to top
View user's profile Send private message
geor



Joined: 16 Jun 2008
Posts: 45

PostPosted: Sat Jul 19, 2008 5:12 am    Post subject: Reply with quote

@scottmattes - thx again, will play w/ your new script later this weekend.

@tank - & thx for pointing out sean's approach,
likewise I'll spend some time with it too.

As far as re-labeling my posts "SOLVED",
if I'm jumping the gun then do let me know.

I saw that effect either here, or on MSFN, or both,
& I thought it was a great idea in principle,
'cause it could make each post a better learning tool.

I just wanted to indicate that I had, indeed,
received a satisfactory/workable answer(s) to the question(s) I asked.

It's very cool, metaphysical really ........
someone flings a question out into cyberspace,
& someone else whom the questioner most likely will never physically meet,
comes along & answers/solves the challenge/problem - Amazing Very Happy

And regarding sean's & others' scripts here ......
I plan to study all of them as closely as I can, as soon as I can.

thx again .....
Back to top
View user's profile Send private message
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