Jump to content

Recommended Posts

Posted

if ClipGet() cannot access the clipboard, it sets @error to 3 OR 4

is there any difference between 3 and 4?

i'm working with Bluegriffon - a mozilla based WYSIWYG html editor - and having some problems where ClipGet() fails with @error = 3 when copying images from the visual editor.

the core code is straight forward

Send("^c")

Sleep(500)

$clipData = ClipGet()

Ctrl+C/V works fine, so i'm wondering if this issue may be specific to Bluegriffon, or if there is something else i'm not seeing

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Posted

Clipget only works for text. The help file says: "Retrieves text from the clipboard."

To retrieve images etc. have a look at the ClipBoard UDF that comes with AutoIt.

My UDFs and Tutorials:

  Reveal hidden contents

 

  • Moderators
Posted

iCode,

You say you are trying to copy images - as far as I know ClipGet only works with text. You need to use the Clipboard.au3 UDF to deal with other formats. ;)

I have not worked much with that UDF - but perhaps this code might help. :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

hi Melba23

i had been using the clipboard UDF and maybe i do need to go back to it

i just started to write that ClipGet works with more than just text, but i think you're right :) i have been incorrectly assuming otherwise all this time because it sets @error to 2 if the clipboard doesn't contain text. when i send ^v, i was assuming i was pasting what ClipGet 'got', but obviously not :)

wow - when it states "Retrieves text from the clipboard.", i guess i should not ignore that

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Posted

  On 11/13/2012 at 6:24 PM, 'iCode said:

wow - when it states "Retrieves text from the clipboard.", i guess i should not ignore that

Right ;)

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

  On 11/13/2012 at 6:24 PM, 'iCode said:

"Retrieves text from the clipboard.", i guess i should not ignore that

I hope you missed this and didn't just dismiss it as being incorrect.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

long story and a dumb mistake on my part ... basically i was using ClipGet to grab the clipboard contents and Ctrl+V to paste - since i copied an image, and pasted an image, i assumed the data pasted was from ClipGet. the fact that ClipGet sets error = 2 if the clipboard is not text caused me to think it works for non-text AND sets error = 2 so you know it wasn't text

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...