AutoHotkey Community

It is currently May 27th, 2012, 4:09 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: September 14th, 2004, 1:40 pm 
Offline

Joined: July 5th, 2004, 9:07 pm
Posts: 56
Location: London
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2004, 2:08 pm 
I guess you've to display the image to capture it :shock:
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 !

8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2004, 3:23 pm 
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.

8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2004, 4:20 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2004, 4:28 pm 
Offline

Joined: July 5th, 2004, 9:07 pm
Posts: 56
Location: London
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2004, 10:08 pm 
Offline

Joined: June 19th, 2004, 9:02 pm
Posts: 68
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2004, 11:06 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, patgenn123, rbrtryn and 70 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