Jump to content
Sign in to follow this  
twelo

ControlSetText Overwrites

Recommended Posts

twelo

using ControlSetText, it Overwrites on previous content

how to make it use with previous texts ?

like a notepad have already some texts, i want to add some more unicode texts using controlsettext without losing my previous texts. how can i ?

and how to make a notepad which supports unicode texts & also save files with unicode chars ?

Share this post


Link to post
Share on other sites
twelo

ControlSetText($title,ControlGetText($title,"",$ID)&$WhateverYourTextIs,$ID)

thanks helping me here what i did

ControlSetText("Untitled", "", "", ControlGetText("Untitled","","")&"NewText","")

from above command i can mix new text with old text either in start position or in end position.

any idea to mix with old in anywhere middle, like whwre your cursor blinks ?

Share this post


Link to post
Share on other sites
bo8ster

You can, firstly you would have to know where the cursor is then you can use something like StringLeft to break up the string.

Local $index = 2 ; the cursor position. I'll leave that for you
Local $currentStr = ControlGetText("Untitled","","")
Local $str = StringLeft($currentStr, $index)
Local $newStr

$newStr = $str & "NewText" & StringRight($currentStr, (StringLen($currentStr) - $index))
ControlSetText("Untitled", "", "", $newStr)

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites
martin

thanks helping me here what i did

ControlSetText("Untitled", "", "", ControlGetText("Untitled","","")&"NewText","")

from above command i can mix new text with old text either in start position or in end position.

any idea to mix with old in anywhere middle, like whwre your cursor blinks ?

Maybe

Clipput($TextToInsert)

Send("^v")


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
twelo

@ bo8ster & martin

i tried what u said above but in both condition i must have to know the already exists text & mouse presence it is useful for static text but it can't help in random dynamically text

may be through line & string count fuctions it can be possible but that will be more messy & long term process

i just want to send unicode texts like controlsend command

any other way to send unicode chars ?

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.