Generate task index for organisation, archive, etc

Discuss RoboTask here
Post Reply
PPX
Posts: 7
Joined: Sat Aug 25, 2018 11:11 pm

Generate task index for organisation, archive, etc

Post by PPX »

Hello, I would like to share this simple task.

It will scan your task folder for any .tsk files and extract from them the internal and external task names alongside the actual filenames and put them in a text file in the task folder.

It should be amended to customise the delimiters and of course make personal the paths. I recommend keeping the index filename the same as it will come at or near the top of the file list when sorted by name (ascending).

I wrote this because I am archiving tasks and want to see at a glance what tasks are held in an archive, as I like to keep my working list of tasks concise so I am deleting any not in active use, while I may wish to retrieve it later and re-use it - this is not possible with the raw filenames, yet can also be done via a content search of the files - I would like to see them all in summary instead.
Attachments
TSK-INDEXER.zip
TASK-INDEXER
(1.69 KiB) Downloaded 739 times
Oleg
Site Admin
Posts: 3010
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Generate task index for organisation, archive, etc

Post by Oleg »

Thank you.

Also I can share the task which creates CSV text with information
  • Task file name
  • Task name
  • Task External name
You can open this CVS file in Excel and sort the list by any column
The task creates file MAP.CSV in task's folder

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1604865554
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task297"
Hide=INTEGER|0
ID=INTEGER|-697266192
LogOnAsUser=INTEGER|1
Name=STRING|"Retrieve task parameters to CSV"
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
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_SCRIPT_VBSCRIPT"
Enabled=INTEGER|-1
Name=STRING|"VB Script"
Params=FOLDER

[Actions\Action1\Params]
expandvars=STRING|"0"
line00000000=STRING|"txt = """""
line00000001=STRING|"for i=0 to RoboTaskApp.TaskCount - 1 step 1"
line00000002=STRING|"  id = RoboTaskApp.TaskInfoID(i)"
line00000003=STRING|"  nam = RoboTaskApp.TaskInfoName(i)"
line00000004=STRING|"  ext = RoboTaskApp.TaskInfoExtname(i)"
line00000006=STRING|"  filename = Hex(id)"
line00000007=STRING|"  while len(filename) < 8"
line00000008=STRING|"    FileName = ""0"" + FileName"
line00000009=STRING|"  wend"
line0000000A=STRING|"  'txt = txt + RoboTaskApp.ExpandText(""{TaskFolder}"") + ""\"" + filename + _"
line0000000B=STRING|"  ' "".tsk = "" + nam + chr(13) + chr(10)"
line0000000C=STRING|"  txt = txt + filename + ""|"" + nam + ""|"" + ext + chr(13) + chr(10)"
line0000000D=STRING|"next"
line0000000F=STRING|"RoboTaskApp.SetUserVariable ""text"", txt"
linecount=STRING|"17"
savescript=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_STR_TRIM"
Enabled=INTEGER|-1
Name=STRING|"STR Trim"
Params=FOLDER

[Actions\Action2\Params]
custom=STRING|"0"
eol=STRING|"1"
lead=STRING|"1"
source=STRING|"{#text}"
spaces=STRING|"1"
tabs=STRING|"1"
trailing=STRING|"1"
variable=STRING|"text"

[Actions\Action3]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""CSVTEXT"" with value """""
Params=FOLDER

[Actions\Action3\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"CSVTEXT"

[Actions\Action4]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER

[Actions\Action4\Params]
destvar=STRING|"LINE"
line0=STRING|"{#text}"
linecount=STRING|"1"
sourcetext=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_VARIABLES_DELIMITED"
Enabled=INTEGER|-1
Name=STRING|"Delimit Variable"
Params=FOLDER

[Actions\Action5\Params]
colon=STRING|"0"
comma=STRING|"0"
other=STRING|"1"
otherchar=STRING|"|"
quote=STRING|"0"
semocolon=STRING|"0"
space=STRING|"0"
spaceasone=STRING|"0"
string=STRING|"{#Line}"
tab=STRING|"0"
variable=STRING|"Line"

[Actions\Action6]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""CSVTEXT"" with value ""{#CSVText}{#Line}{EOL}"""
Params=FOLDER

[Actions\Action6\Params]
expand=STRING|"1"
varname=STRING|"CSVTEXT"
varvalue=STRING|"{#CSVText}{#Line}{EOL}"

[Actions\Action7]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action8]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {TaskFolder}\map.csv"
Params=FOLDER

[Actions\Action8\Params]
encode=STRING|"0"
fileexists=STRING|"0"
filname=STRING|"{TaskFolder}\map.csv"
line0=STRING|"{#CSVtext}"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action9]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""notepad.exe {TaskFolder}\map.csv"""
Params=FOLDER

[Actions\Action9\Params]
ifnonzero=STRING|"0"
params=STRING|"{TaskFolder}\map.csv"
program=STRING|"notepad.exe"
runas=STRING|"0"
wait=STRING|"0"
Save the text of the task into a file and use menu Task->Import to import it into RoboTask
Oleg Yershov
PPX
Posts: 7
Joined: Sat Aug 25, 2018 11:11 pm

Re: Generate task index for organisation, archive, etc

Post by PPX »

Thank you that's great.
Post Reply