Disable reserved symbols

Discuss RoboTask here
Post Reply
alex322
Posts: 4
Joined: Mon Aug 05, 2019 8:30 am

Disable reserved symbols

Post by alex322 »

Hi,

I need to emulate keystrokes from clipboard which may contains special symbols as *,#, { , etc.
But RoboTask recognizes them as special. Is there way disable that behavior?

Thanks in advance.
1_robo.JPG
1_robo.JPG (21.26 KiB) Viewed 8723 times
2_robo.JPG
2_robo.JPG (22.27 KiB) Viewed 8723 times
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Disable reserved symbols

Post by Oleg »

how to use reserved symbols:
How to simulate reserved symbols: ^ % + # { } ( )

You can do this by using Shift combinations, like this
  • ^ - Shift-6 , i.e. +(6)
    % - Shift-5 , i.e. +(5)
    + - Shift-= , i.e. +(=)
    # - Shift-3 , i.e. +(3)
    { - Shift-[ , i.e. +([)
    } - Shift-] , i.e. +(])
    ( - Shift-9 , i.e. +(9)
    ) - Shift-0 , i.e. +(0)
Also it's possible to use these symbols within braces
  • ^ {^}
    % {%}
    + {+}
    # {#}
    { {{}
    } {}}
    ( {(}
    ) {)}
This is described in documentation or help file: https://robotask.com/help/index.php?send_keys.htm
also look at my examples

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1075658632
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task616"
Hide=INTEGER|0
ID=INTEGER|1561581415
LogOnAsUser=INTEGER|1
Name=STRING|"Send special chars (1)"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER

[Actions\Action1]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to ""Notepad"""
Params=FOLDER

[Actions\Action1\Params]
currentwindow=STRING|"0"
fixedwindow=STRING|"0"
keylayout=STRING|"0"
keys=STRING|"""{^}  "",{(},{)},{#},{{},{}},{%},{+}"
pause=STRING|"20"
release=STRING|"0"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
2-nd example. You have to replace all special chars

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1075658632
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task622"
Hide=INTEGER|0
ID=INTEGER|-282476907
LogOnAsUser=INTEGER|1
Name=STRING|"Send special chars (2)"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""OUT"" with value ""^{EOL}%{EOL}+{EOL}#{EOL}{{EOL}}{EOL}({EOL})"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varname=STRING|"OUT"
varvalue=STRING|"^{EOL}%{EOL}+{EOL}#{EOL}{{EOL}}{EOL}({EOL})"

[Actions\Action2]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//you have to replace all reserved symbols"
Params=FOLDER

[Actions\Action2\Params]
comment=STRING|"you have to replace all reserved symbols"

[Actions\Action3]
ActionID=STRING|"A_REGEXP_REPLACE"
Enabled=INTEGER|-1
Name=STRING|"RegExp Replace"
Params=FOLDER

[Actions\Action3\Params]
anchored=STRING|"0"
case=STRING|"0"
extended=STRING|"0"
line00000000=STRING|"^"
line00000001=STRING|"%"
line00000002=STRING|"+"
line00000003=STRING|"#"
line00000004=STRING|"{"
line00000005=STRING|"}"
line00000006=STRING|"("
line00000007=STRING|")"
linecount=STRING|"8"
multiline=STRING|"0"
noautocapture=STRING|"0"
pattern=STRING|"([\^|\%|\+|\#|\{|\}|\(|\)])"
replacementcount=STRING|"0"
replacemode=STRING|"0"
repline00000000=STRING|"{$1}"
replinecount=STRING|"1"
singleline=STRING|"1"
ungreedy=STRING|"0"
useexternal=STRING|"0"
variable=STRING|"out1"

[Actions\Action4]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|0
Name=STRING|"Show ""{out}"""
Params=FOLDER

[Actions\Action4\Params]
icon=STRING|"1"
msg0=STRING|"{out}"
msg1=STRING|"****"
msg2=STRING|"{out1}"
msgcount=STRING|"3"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to ""Notepad"""
Params=FOLDER

[Actions\Action5\Params]
currentwindow=STRING|"0"
fixedwindow=STRING|"0"
keylayout=STRING|"0"
keys=STRING|"{out1}"
pause=STRING|"20"
release=STRING|"0"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Oleg Yershov
alex322
Posts: 4
Joined: Mon Aug 05, 2019 8:30 am

Re: Disable reserved symbols

Post by alex322 »

Hi Oleg,

It's not working for me.

1. I need to type clipboard content and don't know if it contains special chars.

2. I use free version and regex module isn't available.
alex322
Posts: 4
Joined: Mon Aug 05, 2019 8:30 am

Re: Disable reserved symbols

Post by alex322 »

Hi Oleg,

Unfortunately, it's not working for me.

1. I need to type content of clipboard and I can't know if it contains special chars or not.
2. I use Lite version without RegEx module.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Disable reserved symbols

Post by Oleg »

you can use system powershell to make necessary replacements
for example, use such command line:

Code: Select all

powershell -Command "(get-clipboard) -replace '([\^|\%|\+|\#|\{|\}|\(|\)])', '{$1}' | Out-File -encoding ASCII myFile.txt"
You can use regular expressions in this command-line
You will get the file myFile.txt with necessary replacements as a result.

If system Clipboard doesn't contain some reserved symbols the command will return text without changes.
Oleg Yershov
alex322
Posts: 4
Joined: Mon Aug 05, 2019 8:30 am

Re: Disable reserved symbols

Post by alex322 »

Working.

Спасибо Олег.
Post Reply