Copy image to clipboard

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
admazy
Posts: 7
Joined: Thu Jan 15, 2015 6:03 pm

Copy image to clipboard

Post by admazy » Wed Nov 09, 2022 10:40 pm

Hello

FF 55.0.3 (64-bit)
iMacros 8.9.7

The main goal is to paste the image to a Facebook post, I found a way how to paste it from the clipboard, but the problem is that I need to save it somehow before to this clipboard.

Trying to open the image in a new tab and simply copy it with ctrl+c but it doesn't work.

EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>IMG" CHARS="c" MODIFIERS="ctrl"

Any ideas?

Thanks.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Copy image to clipboard

Post by chivracq » Wed Nov 09, 2022 11:00 pm

admazy wrote:
Wed Nov 09, 2022 10:40 pm
Hello

FF 55.0.3 (64-bit)
iMacros 8.9.7

The main goal is to paste the image to a Facebook post, I found a way how to paste it from the clipboard, but the problem is that I need to save it somehow before to this clipboard.

Trying to open the image in a new tab and simply copy it with ctrl+c but it doesn't work.

Code: Select all

EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>IMG" CHARS="c" MODIFIERS="ctrl"
Any ideas?

Thanks.

Yeah, but the Syntax is not correct, for only 1 Char, you need to use:

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>IMG" CHAR="c" MODIFIERS="ctrl"
... And you can otherwise try:

Code: Select all

EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>IMG" CHARS="ac" MODIFIERS="ctrl"
... And also:

Code: Select all

EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY" CHARS="ac" MODIFIERS="ctrl"
... Or even:

Code: Select all

EVENTS TYPE=KEYPRESS SELECTOR=* CHARS="ac" MODIFIERS="ctrl"
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
admazy
Posts: 7
Joined: Thu Jan 15, 2015 6:03 pm

Re: Copy image to clipboard

Post by admazy » Fri Nov 11, 2022 3:31 pm

chivracq wrote:
Wed Nov 09, 2022 11:00 pm
Yeah, but the Syntax is not correct, for only 1 Char, you need to use:

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>IMG" CHAR="c" MODIFIERS="ctrl"
... And you can otherwise try:

Code: Select all

EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>IMG" CHARS="ac" MODIFIERS="ctrl"
... And also:

Code: Select all

EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY" CHARS="ac" MODIFIERS="ctrl"
... Or even:

Code: Select all

EVENTS TYPE=KEYPRESS SELECTOR=* CHARS="ac" MODIFIERS="ctrl"
I did try different syntax combinations but anyway it's not working, for me it looks impossible.

I found a simple standard way to insert image into FB post. It was so easy :lol:

Code: Select all

TAG POS=1 TYPE=SPAN ATTR=TXT:What's<SP>on<SP>your<SP>mind?… EXTRACT=TXT
SET !EXTRACT NULL
TAG POS=R1 TYPE=SPAN ATTR=TXT:Photo/video
TAG POS=1 TYPE=SPAN ATTR=TXT:Add<SP>photos<SP>from<SP>your<SP>mobile<SP>device.
TAG POS=R-1 TYPE=INPUT:FILE FORM=NAME:NoFormName ATTR=* CONTENT=D:\image.jpg
Thanks.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Copy image to clipboard

Post by chivracq » Fri Nov 11, 2022 4:16 pm

admazy wrote:
Fri Nov 11, 2022 3:31 pm
I did try different syntax combinations but anyway it's not working, for me it looks impossible.

I found a simple standard way to insert image into FB post. It was so easy :lol:

Code: Select all

TAG POS=1 TYPE=SPAN ATTR=TXT:What's<SP>on<SP>your<SP>mind?… EXTRACT=TXT
SET !EXTRACT NULL
TAG POS=R1 TYPE=SPAN ATTR=TXT:Photo/video
TAG POS=1 TYPE=SPAN ATTR=TXT:Add<SP>photos<SP>from<SP>your<SP>mobile<SP>device.
TAG POS=R-1 TYPE=INPUT:FILE FORM=NAME:NoFormName ATTR=* CONTENT=D:\image.jpg
Thanks.

Yep-yep, I think it's possible, using the Clipboard, or maybe the `EXTRACT` Mechanism...

But you didn't post any "concrete" Script or any URL, so I couldn't/didn't do any Testing, and I understood from your (a bit vague) Scenario Description, that the Image you wanted to copy was a "Web-Image", not a "Local" Image, but my next Sugg, (if nothing really worked, and I couldn't do any Testing myself), would indeed have been to first save the (Web)-image locally using `SAVEITEM`, to then re-upload it to that Site, using the Syntax you found yourself... :P
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
admazy
Posts: 7
Joined: Thu Jan 15, 2015 6:03 pm

Re: Copy image to clipboard

Post by admazy » Fri Nov 11, 2022 5:20 pm

chivracq wrote:
Fri Nov 11, 2022 4:16 pm
Yep-yep, I think it's possible, using the Clipboard, or maybe the `EXTRACT` Mechanism...

But you didn't post any "concrete" Script or any URL, so I couldn't/didn't do any Testing, and I understood from your (a bit vague) Scenario Description, that the Image you wanted to copy was a "Web-Image", not a "Local" Image, but my next Sugg, (if nothing really worked, and I couldn't do any Testing myself), would indeed have been to first save the (Web)-image locally using `SAVEITEM`, to then re-upload it to that Site, using the Syntax you found yourself... :P
It was a local image previously saved from the web, opened in a new tab in FF. My ideas with `EXTRACT` doesn't work, same as copying it with the 'Context menu' and character 'y' in FF.
User avatar
thecoder2012
Posts: 446
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Copy image to clipboard

Post by thecoder2012 » Fri Mar 03, 2023 4:28 pm

admazy wrote:
Fri Nov 11, 2022 5:20 pm
It was a local image previously saved from the web, opened in a new tab in FF. My ideas with `EXTRACT` doesn't work, same as copying it with the 'Context menu' and character 'y' in FF.
Security reasons in most cases. Check your firefox config dom.events.asyncClipboard.clipboardItem as example. See Copy Image to Clipboard from Browser in Javascript? or clipboard.setImageData().
I have no full example in this case with or without addons or javascript in this case. But it's thinkable.
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
Post Reply