torels Posted May 29, 2008 Posted May 29, 2008 Hi all! I was Wondering how to get the text written in the scite... does somebody know ? thanks in advance Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org
Dickb Posted May 29, 2008 Posted May 29, 2008 Hi all!I was Wondering how to get the text written in the scite...does somebody know ?thanks in advanceThere is a device developed for that. It is called a "Keyboard".
monoceres Posted May 29, 2008 Posted May 29, 2008 Using ControlSend: ControlSend(@ScriptDir,"","[ID:350]",@CRLF&"hello") The @ScriptDir is just there because I found it to be the easiest way to find the SciTE window Broken link? PM me and I'll send you the file!
AdmiralAlkex Posted May 29, 2008 Posted May 29, 2008 He could mean ConsoleWrite() but it's impossible to tell with that badly written grammar .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
NELyon Posted May 29, 2008 Posted May 29, 2008 And I bet I'm the only one who noticed that he says he wants to Get the text written in SciTe
PsaltyDS Posted May 30, 2008 Posted May 30, 2008 I was Wondering how to get the text written in the scite... does somebody know ? SciTE draws its own edit control "[CLASS:Scintilla]", which is not a standard Windows API control. Therefore the text is not directly visible to AutoIt. But, it was coded with standard shortcuts for select all, copy, and paste. So this works: Opt("WinTitleMatchMode", 4) ; Read text from SciTE (already open) WinWait("[CLASS:SciTEWindow; INSTANCE:1]") $hSciTE = WinGetHandle("[CLASS:SciTEWindow; INSTANCE:1]") WinActivate($hSciTE) WinWaitActive($hSciTE) ControlFocus($hSciTE, "", "[CLASS:Scintilla; INSTANCE:1]") ControlSend($hSciTE, "", "[CLASS:Scintilla; INSTANCE:1]", "^a") ControlSend($hSciTE, "", "[CLASS:Scintilla; INSTANCE:1]", "^c") ; Paste text to Notepad Run("Notepad.exe") WinWait("[TITLE:Untitled - Notepad]") $hNotepad = WinGetHandle("[TITLE:Untitled - Notepad]") WinActivate($hNotepad) WinWaitActive($hNotepad) ControlSend($hNotepad, "", "[CLASS:Edit; INSTANCE:1]", "^v") The Scintilla Text Editor (SciTE) is an open source project, and maybe there is more elegant way to read the text using some automation interface, but the brute-force hack above gets the job done. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Developers Jos Posted May 30, 2008 Developers Posted May 30, 2008 Just an alternative with less "hacking" SendSciTE_Command("insert:text to insert at cursor replacing possible selected text.") ; ; Func SendSciTE_Command($sCmd) Opt("WinSearchChildren", 1) ; Get SciTE DirectorHandle $SciTE_hwnd = WinGetHandle("DirectorExtension") Local $WM_COPYDATA = 74 Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']') DllStructSetData($CmdStruct, 1, $sCmd) Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr') DllStructSetData($COPYDATA, 1, 1) DllStructSetData($COPYDATA, 2, StringLen($sCmd) + 1) DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct)) DllCall('User32.dll', 'None', 'SendMessage', 'HWnd', $SciTE_hwnd, _ 'Int', $WM_COPYDATA, 'HWnd', 0, _ 'Ptr', DllStructGetPtr($COPYDATA)) EndFunc ;==>SendSciTE_Command 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.
torels Posted June 1, 2008 Author Posted June 1, 2008 And I bet I'm the only one who noticed that he says he wants to Get the text written in SciTe thanks PsaltyDS & JOS! Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org
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