7 posts in this topic
i want to copy a picture file to clipboard, so that i can paste the picture through ctrl+V
this is my code ,but it dosen't work :
#AutoIt3Wrapper_UseX64 = n #Include <Clipboard.au3> #include <GDIPlus.au3> _GDIPlus_Startup() $hClipboard_Bitmap = _GDIPlus_BitmapCreateFromFile('C:\1.jpg') _ClipBoard_Open(0) _ClipBoard_SetDataEx($hClipboard_Bitmap,$CF_BITMAP) _ClipBoard_Close() _GDIPlus_Shutdown() can you help me
I fail trying to save content from WhatsApp other then plain text to a file that way, that non-char-content will be preserved in it's correct encoding. e.g. Emojis are spoiled.
I've tried to do so using just filewrite() as well as forcing UTF
#include <clipboard.au3> MsgBox(0,"Ready to read clipboard","Mark some WhatsApp content with non-char elements, e.g. Emojis, copy that to your clipboard (CTRL+c), then click OK here.") $ClipContent=_ClipBoard_GetData() ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ClipContent = ' & $ClipContent & @CRLF & '>Error code: ' & @error & @CRLF & "Extended: " & @extended & @CRLF) ;### Debug Console $File="C:\temp\ClipSaveToFile.txt" $h=FileOpen($File,2+8+64) ; overwrite, create path, UTF16 FileWrite($h,$ClipContent) FileClose($h) $h=FileOpen($File,64) $NeuGelesen=FileRead($h) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $NeuGelesen = ' & $NeuGelesen & @CRLF & '>Error code: ' & @error & @CRLF & StringLen ($NeuGelesen) & @CRLF ) ;### Debug Console FileClose($h) _ClipBoard_SetData($NeuGelesen) MsgBox(0,"Done","Re-read content of TEMP file was placed to the clipboard. Now paste this into WhatsApp. (Emojis will be spoiled)") I've also tried other encodings (16, 32, 64, 512)
Or what is a different, functional approach to save WhatsApp Content to File in a way, to be able to to get it back to post it back to WhatsApp?
Its possible to past previously copied text to somewhere with autoit script ?
If yes, How it ?
example : Before I copied ABCD and then copied the PQRS, how to past the previously copied ABCD ?
Wondering what I'm doing wrong.
as per my script, I activate an external program, copy data from it and I want to paste it into excel, after I clear the current sheet that is there.
It is some sort of an array as when I manually paste it into excel it expands across rows and down columns (number of which varies).
This repeats for Xno. of program instances, and consequently I would want it to cycle through x sheets.
So far I have the following, noting that I dont have the sheet clearing thing detailed yet, but I get the following error: "Error copying cells. @error = 4, @extended = -2147352567"
func Primary() For $i=0 to ubound($term)-1 WinActivate($term[$i]) sleep(500) MouseClick("left",$OptX,$opty) Clipput("") sleep(500) send("!a") sleep(100) Do sleep(100) until Clipget() ;activates sheet no. specified by $i+ 1, removes data from sheet and pastes new data, cycles to the next sheet ;function to clear sheet _Excel_RangeCopyPaste($oWorkbook1.Worksheets($i+1), Default , "A1") If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeCopy Example 2", "Error copying cells." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeCopy Example 2", "Range 'A1' from workbook _Excel3.xls successfully copied to 'G15'.") Next EndFunc
Any help would be great.
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?