| View previous topic :: View next topic |
| Author |
Message |
Pallie
Joined: 05 Jul 2004 Posts: 57 Location: London
|
Posted: Tue Sep 14, 2004 12:40 pm Post subject: copy a (jpeg) file to the clipboard |
|
|
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 |
|
 |
BoBo Guest
|
Posted: Tue Sep 14, 2004 1:08 pm Post subject: |
|
|
I guess you've to display the image to capture it
What about to create a dummy HTML page as a vehicle ?
| 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 !
 |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue Sep 14, 2004 2:23 pm Post subject: |
|
|
| 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.
 |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue Sep 14, 2004 3:20 pm Post subject: |
|
|
| 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
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
|
Posted: Tue Sep 14, 2004 3:28 pm Post subject: |
|
|
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 |
|
 |
WhiteCloud
Joined: 19 Jun 2004 Posts: 68
|
Posted: Tue Sep 14, 2004 9:08 pm Post subject: |
|
|
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 |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Tue Sep 14, 2004 10:06 pm Post subject: |
|
|
| 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 |
|
 |
|