nitekram

Get highlighted text, after hitting hotkey

14 posts in this topic

Trying to use a clipget() along with send() (ctrl c) to copy the text, after I hit a hotkey, but it does not work...anyone have a suggestion?

 

#include <Misc.au3>
HotKeySet('!w', 'GetHighlightedWord')
While 1
    Sleep(200)
WEnd

Func GetHighlightedWord()
    Send('{LCTRL}c')
    ;_SendEx('^c') have tried this function as well
    $sWord = ClipGet()
    MsgBox(0, 'What is in the clipboard?', $sWord)


EndFunc   ;==>GetHighlightedWord

Func _SendEx($ss, $warn = "")
    Local $iT = TimerInit()
    While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")

        If $warn <> "" And TimerDiff($iT) > 1000 Then
            MsgBox(0, "Warning", $warn)
        EndIf
        Sleep(50)
    WEnd
    Send($ss)
EndFunc   ;==>_SendEx

 


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites



the problem seems to be that while you are pressing  Alt-w, the GetHighlightedWord() is as well executed nearly at the same time (while your fingers are still pressing down the keyboard keys), having as final result a sum of keypresses, 2 keys pressed by You (Alt-w) and 2 keys pressed by the Send() function (Ctrl-c)
(Alt+w+Ctrl+c as result)
If you add a little delay before the Send('^c') function giving you the time to release your fingers, the function will work.....

#include <Misc.au3>
HotKeySet('!w', 'GetHighlightedWord')
While 1
    Sleep(200)
WEnd

Func GetHighlightedWord()
    Sleep(1000) ;  <-- gives you the time to release your fingers from the keyboard
    Send('^c')
    ;_SendEx('^c') have tried this function as well
    $sWord = ClipGet()
    MsgBox(0, 'What is in the clipboard?', $sWord)


EndFunc   ;==>GetHighlightedWord

Func _SendEx($ss, $warn = "")
    Local $iT = TimerInit()
    While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")

        If $warn <> "" And TimerDiff($iT) > 1000 Then
            MsgBox(0, "Warning", $warn)
        EndIf
        Sleep(50)
    WEnd
    Send($ss)
EndFunc   ;==>_SendEx

 


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites
On 8/25/2016 at 2:48 PM, Chimp said:

the problem seems to be that while you are pressing  Alt-w, the GetHighlightedWord() is as well executed nearly at the same time (while your fingers are still pressing down the keyboard keys), having as final result a sum of keypresses, 2 keys pressed by You (Alt-w) and 2 keys pressed by the Send() function (Ctrl-c)
(Alt+w+Ctrl+c as result)
If you add a little delay before the Send('^c') function giving you the time to release your fingers, the function will work.....

#include <Misc.au3>
HotKeySet('!w', 'GetHighlightedWord')
While 1
    Sleep(200)
WEnd

Func GetHighlightedWord()
    Sleep(1000) ;  <-- gives you the time to release your fingers from the keyboard
    Send('^c')
    ;_SendEx('^c') have tried this function as well
    $sWord = ClipGet()
    MsgBox(0, 'What is in the clipboard?', $sWord)


EndFunc   ;==>GetHighlightedWord

Func _SendEx($ss, $warn = "")
    Local $iT = TimerInit()
    While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")

        If $warn <> "" And TimerDiff($iT) > 1000 Then
            MsgBox(0, "Warning", $warn)
        EndIf
        Sleep(50)
    WEnd
    Send($ss)
EndFunc   ;==>_SendEx

 

I had to add 2000 to the sleep...I will keep playing with it, to see if the number can be reduced...thanks


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Try this: highlite word or sentence and drag to the drop-window, the script:

;https://autoit.de/index.php/Thread/22579-Dropbox-f%C3%BCr-Links-aus-Browsern/?postID=185846#post185846
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


Local $hGui, $iMsg
$hGui = GUICreate("Dropbox", 150, 150, -1, -1, BitOR($WS_SIZEBOX, $WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
GUICtrlSetState(-1, $GUI_ONTOP)
$hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 0, 0, 150, 150, -1)
GUISetState()
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
_GUICtrlRichEdit_SetEventMask($hRichEdit, $ENM_SELCHANGE)
While True
    $iMsg = GUIGetMsg()
    Select
        Case $iMsg = $GUI_EVENT_CLOSE
            _GUICtrlRichEdit_Destroy($hRichEdit)
            GUIDelete()
            Exit
    EndSelect
WEnd

Func WM_NOTIFY($hWnd, $iMsg, $iWparam, $iLparam)
    #forceref $hWnd, $iMsg, $iWparam
    Local $hWndFrom, $iCode, $tNMHDR, $tEnLink, $cpMin, $cpMax, $tMsgFilter
    $tNMHDR = DllStructCreate($tagNMHDR, $iLparam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hRichEdit
            Select
                Case $iCode = $EN_SELCHANGE
                    Checklink()
            EndSelect
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY


Func Checklink()
    Local $sURL, $arrValidURL
    $sURL = _GUICtrlRichEdit_GetText($hRichEdit)
    ConsoleWrite($sURL&@CRLF)
    $arrValidURL = StringRegExp($sURL, "(?s)((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)", 2)

    #comments-start
    _GUICtrlRichEdit_GetSelText($hRichEdit)
    _GUICtrlRichEdit_SetText($hRichEdit, "")
    If UBound($arrValidURL) > 0 Then
        ;// Gueltige URL ok, mach irgendwas damit
        ConsoleWrite($arrValidURL[0] & @CRLF)
        InetGet($arrValidURL[0],'test.jpg')
        ShellExecute('test.jpg')
        ;//
    EndIf
    #comments-end
EndFunc   ;==>Checklink

waiting for new drop input in the RTF-Control, you have only to change the action after line #44.

Edited by AutoBert

Share this post


Link to post
Share on other sites
21 hours ago, AutoBert said:

Try this: highlite word or sentence and drag to the drop-window, the script:

I am unable to perform this action, and I am not sure what this does, as I was able to type in the box - I assume that the consolewrite (line 44) allows me to do something?


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

If you aren't able to Drag & Drop try the example to _ClipBoard_SetViewer. After start copy some text in browser or other app and have a look in the Memo Gui.

Share this post


Link to post
Share on other sites
3 minutes ago, AutoBert said:

If you aren't able to Drag & Drop try the example to _ClipBoard_SetViewer. After start copy some text in browser or other app and have a look in the Memo Gui.

I am able to see the information in the GUI after hitting Ctrl C, but not sure how that is going to help me with what I am trying to do?


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites
1 minute ago, nitekram said:

I am able to see the information in the GUI after hitting Ctrl C, but not sure how that is going to help me with what I am trying to do?

Then a good starting point is to open the helpfile, reading the Language Reference. The example shows how to get ClipBoard and put data in Edit-Control.

Share this post


Link to post
Share on other sites

I am not sure I understand...I am trying to automate the population of the clipboard. By hitting one hot key, that will both start my function and copy the highlighted text. If this will do that, great, but I have never messed with these functions before, so I would need a primer to go with the examples?


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

Geting highlited text is very difficult, the example i showed is not so complicated, so i don't understood why you don't know how to change for your needs.

Share this post


Link to post
Share on other sites
12 minutes ago, AutoBert said:

Geting highlited text is very difficult, the example i showed is not so complicated, so i don't understood why you don't know how to change for your needs.

It could be, because I am not that smart lol

The example you showed has me drag my highlighted text to a window, which I was not able to get to work...all I want is to be able to hit a hotkey, and from that function call, copy the highlighted text with sending ctrl c - coping the info to the clipboard. The delay that was mentioned before...I was able to put in a command to write to the console, and that was just enough delay to get the function working...the below code works as I want it, but I will be looking at these functions to see how I might be able to use them in the future for a clipboard keeper I have wanted to create.

 

#include <Misc.au3>
HotKeySet('^!w', 'GetHighlightedWord')
While 1
    Sleep(200)
WEnd

Func GetHighlightedWord()
    ;Sleep(2000) ;  <-- gives you the time to release your fingers from the keyboard
    ConsoleWrite('anything here for a delay')
    Send('^c')
    ;_SendEx('^c') have tried this function as well
    $sWord = ClipGet()
    MsgBox(0, 'What is in the clipboard?', $sWord)


EndFunc   ;==>GetHighlightedWord

Func _SendEx($ss, $warn = "")
    Local $iT = TimerInit()
    While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")

        If $warn <> "" And TimerDiff($iT) > 1000 Then
            MsgBox(0, "Warning", $warn)
        EndIf
        Sleep(50)
    WEnd
    Send($ss)
EndFunc   ;==>_SendEx

 


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites
3 hours ago, AutoBert said:

If you aren't able to Drag & Drop try the example to _ClipBoard_SetViewer. After start copy some text in browser or other app and have a look in the Memo Gui.

If want selected text, the mentioned esample  (_ClipBoard_SetViewer) is the easiest way. Just a right click and a click on copy item and the selected text is in result of _ClipBoard_GetData(). But i prefer the Drag & Drop example, here is the selected text in the result of _GUICtrlRichEdit_GetText. I prefer this way, as it fetches only was i realy want. 

Share this post


Link to post
Share on other sites

Remember doing this at some point, script was something like...

Func GetHighlightedWord()
    ClipPut("")
    Do
        Send('^c')
        Sleep(10)
    Until ClipGet() <> ""
EndFunc

Probably had a timeout, and a test that "" actually got put in the clipboard.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
2 hours ago, JohnOne said:

Remember doing this at some point, script was something like...

Func GetHighlightedWord()
    ClipPut("")
    Do
        Send('^c')
        Sleep(10)
    Until ClipGet() <> ""
EndFunc

Probably had a timeout, and a test that "" actually got put in the clipboard.

That looks like it would work as well...thanks.


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • mmoalem
      By mmoalem
      I seem to have an issue with clipget() - the following bit of code copy URL from chrome address bar - than using clipget() i try to grab the URL into a variable and input it into a spreadsheet. the script did not put anything into the sheet 
      originally I though it was an issue with  OOo/LibO Calc UDF and posted it there :
       
      than I tried writing $NewURL into a text file and than just a msgbox but it comes blank. (the URL is in the clipboard as i can paste it)
       
      send ("!d") ;select URL in browser send ("^c") ;copy selected URL Local $NewURL = ClipGet() MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, $sTitle, $NewURL ) am I doing something wrong? is there an issue with a URL characters?
    • piterek
      By piterek
      Hi...
      How to put data to clipboard in all available formats?   I use _ClipBoard_GetData to save all formats data to files but when I try to put them again to clipboard using _ClipBoard_SetData, I have available  only the last data format which I used. After that when I try put this data to "Microsoft Word" I get only "Cleaned" text format.  When I the set last format as a HTML and I put to "Micorosft Word" everything fine, but I can't put to Notepad (I get empty value).    When I doing this same with _ClipBoard_GetDataEx to save data to memory object (not to file) and put them again using _ClipBoard_SetDataEx all data formats are available...   Help?   
    • nf67
      By nf67
      Hi all,

      I've been copying a lot of text from PDF files and other documents. Problem is, this text appears badly mangled when pasted again, causing formatting issues. I've been trying to write a script that would automatically reformat the copied string:


      #include <Clipboard.au3> #include <Misc.au3> If _Singleton("PasteModify", 1) = 0 Then MsgBox(0, "NOPE.", "Already Running.") Exit EndIf #NoTrayIcon Opt("TrayMenuMode", 1) $AboutTrayItem = TrayCreateItem("About") TrayCreateItem("") $ExitTrayItem = TrayCreateItem("Exit") TraySetState() $hDLL = DllOpen("user32.dll") Beep(1100,300) While 1 While _IsPressed("11",$hDLL) If _IsPressed("43",$hDLL) Then Beep(1300,150) ;Sleep(750) ;fixes the issue, but not very elegantly. $OriginalClipboardData = ClipGet() $ClipGetError = @error $RegexClipboardData = StringRegExpReplace($OriginalClipboardData, '[\r\n\t]+', ' ') $StripWSClipboardData = StringStripWS($RegexClipboardData,4) ClipPut($StripWSClipboardData) MsgBox(0,$ClipGetError,"ORIGINAL: " & $OriginalClipboardData & @CRLF & @CRLF & "POST-REGEX APPLIED: " & StringRegExpReplace($OriginalClipboardData, '[\r\n\t]+', ' ') & @CRLF & @CRLF & "STRIPWS APPLIED: " & $StripWSClipboardData & @CRLF & @CRLF & "END RESULT: " & ClipGet()) While _IsPressed("43",$hDLL) Sleep(250) WEnd EndIf WEnd Local $msg = TrayGetMsg() Select Case $msg = $AboutTrayItem MsgBox(64, "About", "When CTRL+C is pressed, a reformatted version of the string that has thereby been copied, without any newline characters, should be placed on the clipboard.") Case $msg = $ExitTrayItem ExitLoop EndSelect WEnd DllClose($hDLL) Beep(600,300)
      However, every now and then it seems like there's a conflict between this script Windows' access to the clipboard.

      If I don't include a long enough sleep (see script), ClipGet() will return that my clipboard is empty, even though it wasn't empty before and I have only selected new text and pressed Ctrl+C since.

      Any suggestions? Could I check for clipboard access perhaps...?
    • iCode
      By iCode
      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