WhOOt Posted August 20, 2005 Share Posted August 20, 2005 ey... i'd like, to clipput a file, like this Func _captureclip() $number = iniread("C:\Screenshots\ini.ini", "ini", "ini", "") $number = $number - 1 $file = "C:\Screenshots\Screenshot\" & $number file clipput($file) EndFunc but as the smart scripter can see, i get the text 'C:\Screenshots\Screenshot\" & $number' in my clipboard.. my question is How do i put a file into the clipboard, with autoit? and is it even possible? ~WhOOt Link to comment Share on other sites More sharing options...
Developers Jos Posted August 20, 2005 Developers Share Posted August 20, 2005 try: Func _captureclip() $number = IniRead("C:\Screenshots\ini.ini", "ini", "ini", "") $number = $number - 1 $file = "C:\Screenshots\Screenshot\" & $number $file_text = FileRead($file,FileGetSize($file)) ClipPut($file_text) EndFunc ;==>_captureclip SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
WhOOt Posted August 20, 2005 Author Share Posted August 20, 2005 try:Func _captureclip() $number = IniRead("C:\Screenshots\ini.ini", "ini", "ini", "") $number = $number - 1 $file = "C:\Screenshots\Screenshot\" & $number $file_text = FileRead($file,FileGetSize($file)) ClipPut($file_text) EndFunc ;==>_captureclip <{POST_SNAPBACK}>mmmm... it doesnt seem to work for me.. i've got a script here, wich i guess seems to be really hard to read its nothing fancy, in fact its crap Please help me out, on makin' it workin' expandcollapse popupglobal $number = "Screenshot" global $checkname = "0" global $number = "1" while 1 hotkeyset("^f", "_capture") hotkeyset("^d", "_captureclip") hotkeyset("^n", "_name") sleep(70) wend ;the capturer, wich saves the Screenshots to C:\Screenshots\ func _capture() $number = iniread("C:\Screenshots\ini.ini", "ini", "ini", "") if @error then _error() ; Capture full screen ; Fist parameter - filename, last - jpeg quality. DllCall("captdll.dll", "int", "CaptureScreen", "str", "dump_full.jpg", "int", 85) dircreate("C:\Screenshots") iniread("C:\Screenshots\ini.ini", "ini", $number, "") if @error then iniwrite("C:\Screenshots\ini.ini", "ini", $number, "") elseif not @error then $number = $number +1 filemove("dump_full.jpg", "C:\Screenshots\"& "ini" & $number & ".jpg") iniwrite("C:\Screenshots\ini.ini", "ini", "ini", $number) endif endfunc func _name() $number = 0 $number = inputbox("Insert Screenshot name", "Here") $dubblecheck = iniread("C:\Screenshots\ini.ini", "ini", "name", "ini") if $checkname >0 then sleep(10) elseif $checkname <0 then iniwrite("C:\Screenshots\ini.ini", "ini", "ini", $number) $number = "0" endif EndFunc ;Captureclip doesnt work Func _captureclip() DllCall("captdll.dll", "int", "CaptureScreen", "str", "dump_full.jpg", "int", 85) $number = IniRead("C:\Screenshots\ini.ini", "ini", "ini", "") filemove("dump_full.jpg", "C:\Screenshots\"& "ini" & $number & ".jpg") $number = $number - 1 $file = "C:\Screenshots\Screenshot\" & $number $file_text = FileRead($file,FileGetSize($file)) ClipPut($file_text) EndFunc ;==>_captureclip ;If you get errored :) func _error() if not fileexists("C:\Screenshots\ini.ini") Then iniwrite("C:\Screenshots\ini.ini", "ini", "ini", "1") endif endfunc Link to comment Share on other sites More sharing options...
Valuater Posted August 20, 2005 Share Posted August 20, 2005 (edited) First you have the use of "ini" too many times ( i believe) The actual problem.... I think its here filemove("dump_full.jpg", "C:\Screenshots\"& "ini" & $number & ".jpg") ..... $file = "C:\Screenshots\Screenshot\" & $number the location of these are diffferent 8) Edited August 20, 2005 by Valuater Link to comment Share on other sites More sharing options...
WhOOt Posted August 20, 2005 Author Share Posted August 20, 2005 (edited) First you have the use of "ini" too many times ( i believe)The actual problem.... I think its here filemove("dump_full.jpg", "C:\Screenshots\"& "ini" & $number & ".jpg").....$file = "C:\Screenshots\Screenshot\" & $numberthe location of these are diffferent8)<{POST_SNAPBACK}>Oke, i've cleaned my script out, totaly.Now only the most important is left.expandcollapse popupglobal $number = "Screenshot" global $checkname = "0" global $number = "1" while 1 hotkeyset("^f", "_capture") hotkeyset("^d", "_captureclip") hotkeyset("^n", "_name") sleep(70) wend ;the capturer, wich saves the Screenshots to C:\Screenshots\ func _capture() ;DllCall is what makes the Screenshot. DllCall("captdll.dll", "int", "CaptureScreen", "str", "dump_full.jpg", "int", 85) dircreate("C:\Screenshots") filemove("dump_full.jpg", "C:\Screenshots\Screenshot.jpg") endfunc func _name() EndFunc ;Captureclip doesnt work Func _captureclip() DllCall("captdll.dll", "int", "CaptureScreen", "str", "dump_full.jpg", "int", 85) dircreate("C:\Screenshots") filemove("dump_full.jpg", "C:\Screenshots\Screenshot.jpg") $file = "C:\Screenshots\Screenshot.jpg" $file_text = FileRead($file,FileGetSize($file)) ClipPut($file_text) EndFunc;==>_captureclip ;If you get errored :) func _error() msgbox(0, "Error", "Error") endfuncI've still got a prob, with the Captureclip... i really dont understand it :SEDIT: The captureclip output is : ÿØÿàif i output it in notepad.it doesnt do anything, if i output it in a folder..Thanks~WhOOt Edited August 20, 2005 by WhOOt Link to comment Share on other sites More sharing options...
Developers Jos Posted August 20, 2005 Developers Share Posted August 20, 2005 k.. guess your file you want loaded in the clipboard is a picture and not readable text..... Don't think you can load that by just reading the file or defining its name. You probably need to load the picture with a program that can display it and then load it into the clipboard. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
WhOOt Posted August 20, 2005 Author Share Posted August 20, 2005 k.. guess your file you want loaded in the clipboard is a picture and not readable text.....Don't think you can load that by just reading the file or defining its name. You probably need to load the picture with a program that can display it and then load it into the clipboard.<{POST_SNAPBACK}>i dont think we understand each other... maybe i dont understand you but i want to output the file, as if i pressed ctrl+c on it.then press ctrl+v to output it.= copy the file from one place to another...Hope i express myself clearly enough..~WhOOt Link to comment Share on other sites More sharing options...
WhOOt Posted August 20, 2005 Author Share Posted August 20, 2005 the _capture doesn't work for meI get a c:\screenshot folder that is empty (win xp)does this work for you??is there a pic in the folder??8)<{POST_SNAPBACK}>yup, it works....you missed the .dll call... you need the speceficed dllfileI attached it ~WhOOtcaptdll.dll Link to comment Share on other sites More sharing options...
MHz Posted August 21, 2005 Share Posted August 21, 2005 $file = "C:\Screenshots\Screenshot.jpg" $file_text = FileRead($file,FileGetSize($file)) ClipPut($file_text)I've still got a prob, with the Captureclip... i really dont understand it :SEDIT: The captureclip output is : ÿØÿàif i output it in notepad.it doesnt do anything, if i output it in a folder..<{POST_SNAPBACK}>i dont think we understand each other... maybe i dont understand you but i want to output the file, as if i pressed ctrl+c on it.then press ctrl+v to output it.= copy the file from one place to another...Hope i express myself clearly enough..~WhOOt<{POST_SNAPBACK}>Just to clarify.JdeB is correct with what he has stated. What he should have said though, you absolutely cannot FileRead() a jpg file, and you absolutely cannot ClipPut() a picture. A jpg is a compressed picture, so it is binary, not text. AutoIt cannot directly read binary.Now since you have a jpg in a variable, then there is no known method, unless a DllCall could be used to add it to the clipboard. Or as JdeB has mentioned, script a program that can handle the graphic for you.If you mean something else, then it is not displayed in this thread. Link to comment Share on other sites More sharing options...
Kendall Posted November 28, 2010 Share Posted November 28, 2010 Just to clarify.JdeB is correct with what he has stated. What he should have said though, you absolutely cannot FileRead() a jpg file, and you absolutely cannot ClipPut() a picture. A jpg is a compressed picture, so it is binary, not text. AutoIt cannot directly read binary.Now since you have a jpg in a variable, then there is no known method, unless a DllCall could be used to add it to the clipboard. Or as JdeB has mentioned, script a program that can handle the graphic for you.If you mean something else, then it is not displayed in this thread.You could use something like, _ClipPutFile if it is a actual file\ picture and if you are wanting it saved to the clipboard file wise then the DLL or even a COM mabey the best route. The Codemonkeyhttp://www.BMVHDloader.com Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now