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 

copy a (jpeg) file to the clipboard

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



Joined: 05 Jul 2004
Posts: 57
Location: London

PostPosted: Tue Sep 14, 2004 12:40 pm    Post subject: copy a (jpeg) file to the clipboard Reply with quote

Hi

I thought this would be simple, but it has foxed me!

I want to copy a jpg file to the clipboard so that I can paste it elsewhere (the actual picture, not the file name). I have tried using loop, read but the documentation says it is only for text files so I'm not surprised it did not work.

I tried using ezclip, eb.zip, but to no avail

Thanks for any suggestions

Mike
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Sep 14, 2004 1:08 pm    Post subject: Reply with quote

I guess you've to display the image to capture it Shocked
What about to create a dummy HTML page as a vehicle ? Idea

Code:
FileAppend, <html><body><img src=file://C:\MyImage.jpg></body><html>, C:\LetsShowItBaby.htm ; a viewer!
Run, iexplore -k "C:\LetsShowItBaby.htm" ; display the image in IE's kiosk mode
Send, !a ; select all
Send, ^c ; copy to clipboard
WinClose ; close IE = active window


Untested !

Cool
Back to top
BoBo
Guest





PostPosted: Tue Sep 14, 2004 2:23 pm    Post subject: Reply with quote

Code:
MyImage = C:\My.jpg
Run, "C:\Program Files\Internet Explorer\IEXPLORE.EXE" -k %MyImage% ; viewer !

WinWaitActive,%MyImage% ; display the image in IE's kiosk mode
Send, ^a ; select all
Send, ^c ; copy to clipboard
WinClose ; close IE = active window
ExitApp


Tested.

Cool
Back to top
BoBo
Guest





PostPosted: Tue Sep 14, 2004 3:20 pm    Post subject: Reply with quote

Code:
MyImage = C:\My.jpg
Run, "C:\Program Files\Internet Explorer\IEXPLORE.EXE" -k %MyImage%
Sleep, 500
Send, ^a ; select all
Send, ^c ; copy to clipboard
Send, !{F4}
ExitApp


Tweaked Wink

For testing you can use (Win)word as a target to paste the image.
Back to top
Pallie



Joined: 05 Jul 2004
Posts: 57
Location: London

PostPosted: Tue Sep 14, 2004 3:28 pm    Post subject: Reply with quote

Thanks BoBo

That works a treat.

I added

, , hide

on the end of the Run IE statement and you don't even get it flashing up briefly.

Thanks again

Mike
Back to top
View user's profile Send private message
WhiteCloud



Joined: 19 Jun 2004
Posts: 68

PostPosted: Tue Sep 14, 2004 9:08 pm    Post subject: Reply with quote

hey this looks like a great candidate for the script showcase. Thanks!

One of you would be better at brainstorming this than I would: Are there any other file types this could be made to work for? Any other than pictures?
_________________
AHK = Hella fun
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue Sep 14, 2004 10:06 pm    Post subject: Reply with quote

Quote:
hey this looks like a great candidate for the script showcase
I would, but doesn't it seem likely that there's a small command line utility out there to do this? It seems like such a common task that someone is sure to have invented it.
Back to top
View user's profile Send private message Send e-mail
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