@Gintaras
Worked well, thanks very much
I just implemented a similar feature in QM2, PS: May not be perfect, welcome to correct
QM2 is really like a legend, I can understand the code QM setting hotkeys is more convenient, Faster startup and execution
but for Uiscripter, it is still difficult to understand, maybe I need to learn more programming knowledge
Macro Macro14
Trigger F4
I found a problem, the flag 4 didn't work
4 click to hide
OnScreenDisplay d.trim 1 0.5 0.5 "" 36 0xFF0000 4
Worked well, thanks very much
I just implemented a similar feature in QM2, PS: May not be perfect, welcome to correct
QM2 is really like a legend, I can understand the code QM setting hotkeys is more convenient, Faster startup and execution
but for Uiscripter, it is still difficult to understand, maybe I need to learn more programming knowledge
Macro Macro14
Trigger F4
Acc ac = acc(mouse)
_s = ac.Name
if (empty(_s))
,int h = child(mouse)
,if h=0
,,h = win(mouse)
,_s.getwintext(h)
ARRAY(str) tl
sub.GetTranslation(_s "en" "zh_cn" tl)
str d=tl
OnScreenDisplay d.trim 1 0.5 0.5 "" 36 0xFF0000 4
#sub GetTranslation
function ~sourceText ~sourceLang ~targetLang ARRAY(str)&tl
sourceText.escape(11)
str s
IntGetFile F"https://translate.googleapis.com/translate_a/single?client=gtx&sl={sourceLang}&tl={targetLang}&dt=t&q={sourceText}" s
IXml x=JsonToXml(s)
IXmlNode r=x.RootElement
ARRAY(IXmlNode) a; r.Path("item/item/item[@type='string']" a 1)
for(int'i 0 a.len)
,,if(!(i&1))
,,,tl[]=a[i].Value
I found a problem, the flag 4 didn't work
4 click to hide
OnScreenDisplay d.trim 1 0.5 0.5 "" 36 0xFF0000 4