few questions

Discuss RoboTask here
Post Reply
ark2
Posts: 9
Joined: Sun Apr 18, 2004 5:44 am

few questions

Post by ark2 »

Hi,

ok, first of all, I'm trying to setup file monitor, few problems, the directory for example on my hard drive locally is c:\crm20 on the ftp server that's the root directory, so I am trying to remove the crm20\ from the create folder and upload step:

{EXTRACTFILEPATHNODRIVE(replace(FILETOPROCESS,"crm20\",""))}

I don't think it works?

also, I need to upload a temp file first since the script size is pretty big and upload takes a few seconds, so I'm trying to upload the file and then rename it on the ftp server, again it doesn't work...

{EXTRACTFILEPATHNODRIVE(replace(FILETOPROCESS,"crm20\",""))} .tmp

are the above possible to setup?

also, I want to avoid creating the text file with filenames and simply run the upload task seperately on each file created/modified, is that possible? just to store a single filename in a variable and upload that per running task?

also, are you planning on adding support to run sapi4 and/or sapi5 tts voices?

I have a bunch to use on my website, it would be great to also be able to add dynamic voice to the tasks.

TIA
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

few questions

Post by Oleg »

ok, first of all, I'm trying to setup file monitor, few problems, the directory for example on my hard drive locally is c:\crm20 on the ftp server that's the root directory, so I am trying to remove the crm20\ from the create folder and upload step:
{EXTRACTFILEPATHNODRIVE(replace(FILETOPROCESS,"crm20\",""))}
Sorry, I don't understand you. Why so long?
If your local folder is "c:\crm20" the expression {EXTRACTFILEPATHNODRIVE(replace(FILETOPROCESS,"crm20\",""))} always equals to empty string. By the way, what is "replace"? Robotask have not such macrovariable.
also, I want to avoid creating the text file with filenames and simply run the upload task seperately on each file created/modified, is that possible? just to store a single filename in a variable and upload that per running task?
Why you don't like loops? Or you want to upload a few files at once (simultaneously)? It is possible, but some complexer. You need to create a bundle of a few tasks. I can create an example if needed.
also, are you planning on adding support to run sapi4 and/or sapi5 tts voices?
For voice messages you can use any Microsoft Agent (for example Merlin). Examples on BASIC is included into Basic plugin for RoboTask.
ark2
Posts: 9
Joined: Sun Apr 18, 2004 5:44 am

few questions

Post by ark2 »

Hi,

yes the crm20 directory needs to be removed, because there is no crm20 directory on the server. while there are still subdirectories under it with files that need to be uploaded from time to time.

yep, I don't like loops =) I want to upload one file at a time when it's triggered. is that doable?

example would be great.

I have some at&t true voice tts voices, any way we can use that?
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

few questions

Post by Oleg »

See example below. This task is monitoring c:\crm20 folder for new or changed files. If changes exists the task uploads all changed files to FTP.
You must install BASIC plugin for this task. After importing into RoboTask do not forget to set "Enabled" property of the task.

;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|565106205
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task3"
Hide=INTEGER|0
ID=INTEGER|1531003466
Name=STRING|"Monitor Files To upload"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action10=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_TASKS_DISABLE"
Enabled=INTEGER|-1
Name=STRING|"Disable Task ""Monitor Files To upload"""
Params=FOLDER

[Actions\Action1\Params]
taskid=STRING|"1531003466"

[Actions\Action10]
ActionID=STRING|"A_TASKS_ENABLE"
Enabled=INTEGER|-1
Name=STRING|"Enable Task ""Monitor Files To upload"""
Params=FOLDER

[Actions\Action10\Params]
taskid=STRING|"1531003466"

[Actions\Action2]
ActionID=STRING|"A_FTP_LOGON"
Enabled=INTEGER|-1
Name=STRING|"FTP Log On"
Params=FOLDER

[Actions\Action2\Params]
anonymous=STRING|"1"
host=STRING|"localhost"
passive=STRING|"1"
password=STRING|"42310383162884337286400984055142142"
port=STRING|"21"
username=STRING|"anonymous"

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

[Actions\Action3\Params]
destvar=STRING|"FILE_TO_UPLOAD"
file=STRING|"c:\filestoupload.txt"
linecount=STRING|"0"
sourcetext=STRING|"0"

[Actions\Action4]
ActionID=STRING|"BASIC_SCRIPT"
Enabled=INTEGER|-1
Name=STRING|"Basic Script"
Params=FOLDER

[Actions\Action4\Params]
line00000=STRING|"' This scrit removed ""crm20"" from path"
line00001=STRING|"' and lead ""\"" if exists"
line00002=STRING|"' assign value to FTP_path variable"
line00004=STRING|"Sub Main"
line00005=STRING|" Dim s As String"
line00007=STRING|" s = RoboTaskApp.ExpandText(""{ExtractFilePathNoDrive({File_To_Up load})}"")"
line00009=STRING|" s = Replace(s,""crm20"","""")"
line00011=STRING|" If Left(s,1) = ""\"" Then"
line00012=STRING|"    s = Replace( s,""\"","""",1,1)"
line00013=STRING|" End If"
line00015=STRING|" RoboTaskApp.SetUserVariable(""FTP_path"",s)"
line00016=STRING|"End Sub"
linecount=STRING|"17"
source=STRING|"0"

[Actions\Action5]
ActionID=STRING|"A_FTP_CREATEFOLDER"
Enabled=INTEGER|-1
Name=STRING|"FTP Create Folder"
Params=FOLDER

[Actions\Action5\Params]
folder=STRING|"{FTP_PATH}"

[Actions\Action6]
ActionID=STRING|"A_FTP_UPLOAD"
Enabled=INTEGER|-1
Name=STRING|"FTP Upload"
Params=FOLDER

[Actions\Action6\Params]
file=STRING|"{FILE_TO_UPLOAD}"
folder=STRING|"{FTP_PATH}"

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

[Actions\Action7\Params]
icon=STRING|"1"
msg0=STRING|"{File_to_upload}"
msg1=STRING|"{FTP_path}"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"

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

[Actions\Action9]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER

[Actions\Action9\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"c:\filestoupload.txt"
subdir=STRING|"0"
ToRecycleBin=STRING|"0"

[Events]
Event1=FOLDER

[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_FILE_MONITOR"
Params=FOLDER

[Events\Event1\Params]
chg=STRING|"1"
chga=STRING|"1"
chgsl=STRING|"1"
chgsm=STRING|"1"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"0"
folder1=STRING|"C:\crm20"
foldercount=STRING|"1"
id=STRING|"292XCHJTR"
incmask=STRING|"*.*"
interval=STRING|"15"
listmode=STRING|"1"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"1"
onelist=STRING|"c:\filestoupload.txt"
saveresults=STRING|"1"
subfolders1=STRING|"1"
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

few questions

Post by Oleg »

About voices: I wrote this suggestion to our ToDo list
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

few questions

Post by Oleg »

I've changed the task. After uploading of each file Merlin speaks about it.
MS Agents and speach API you can download here

;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|565106205
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task3"
Hide=INTEGER|0
ID=INTEGER|1531003466
Name=STRING|"Monitor Files To upload"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_TASKS_DISABLE"
Enabled=INTEGER|-1
Name=STRING|"Disable Task ""Monitor Files To upload"""
Params=FOLDER

[Actions\Action1\Params]
taskid=STRING|"1531003466"

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

[Actions\Action10\Params]
icon=STRING|"1"
msg0=STRING|"{File_to_upload}"
msg1=STRING|"{FTP_path}"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"

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

[Actions\Action12]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER

[Actions\Action12\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"c:\filestoupload.txt"
subdir=STRING|"0"
ToRecycleBin=STRING|"0"

[Actions\Action13]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""FTP_PATH"""
Params=FOLDER

[Actions\Action13\Params]
varname=STRING|"FTP_PATH"

[Actions\Action14]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""FILE_TO_UPLOAD"""
Params=FOLDER

[Actions\Action14\Params]
varname=STRING|"FILE_TO_UPLOAD"

[Actions\Action15]
ActionID=STRING|"A_TASKS_ENABLE"
Enabled=INTEGER|-1
Name=STRING|"Enable Task ""Monitor Files To upload"""
Params=FOLDER

[Actions\Action15\Params]
taskid=STRING|"1531003466"

[Actions\Action2]
ActionID=STRING|"A_FTP_LOGON"
Enabled=INTEGER|-1
Name=STRING|"FTP Log On"
Params=FOLDER

[Actions\Action2\Params]
anonymous=STRING|"1"
host=STRING|"localhost"
passive=STRING|"1"
password=STRING|"42310383162884337286400984055142142"
port=STRING|"21"
username=STRING|"anonymous"

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

[Actions\Action3\Params]
destvar=STRING|"FILE_TO_UPLOAD"
file=STRING|"c:\filestoupload.txt"
linecount=STRING|"0"
sourcetext=STRING|"0"

[Actions\Action4]
ActionID=STRING|"BASIC_SCRIPT"
Enabled=INTEGER|-1
Name=STRING|"Basic Script"
Params=FOLDER

[Actions\Action4\Params]
line00000=STRING|"' This scrit removed ""crm20"" from path"
line00001=STRING|"' and lead ""\"" if exists"
line00002=STRING|"' assign value to FTP_path variable"
line00004=STRING|"Sub Main"
line00005=STRING|" Dim s As String"
line00007=STRING|" s = RoboTaskApp.ExpandText(""{ExtractFilePathNoDrive({File_To_Up load})}"")"
line00009=STRING|" s = Replace(s,""crm20"","""")"
line00011=STRING|" If Left(s,1) = ""\"" Then"
line00012=STRING|"    s = Replace( s,""\"","""",1,1)"
line00013=STRING|" End If"
line00015=STRING|" RoboTaskApp.SetUserVariable(""FTP_path"",s)"
line00016=STRING|"End Sub"
linecount=STRING|"17"
source=STRING|"0"

[Actions\Action5]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action5\Params]
case=STRING|"0"
operator=STRING|"8"
type=STRING|"0"
value1=STRING|"{FTP_PATH}"

[Actions\Action6]
ActionID=STRING|"A_FTP_CREATEFOLDER"
Enabled=INTEGER|-1
Name=STRING|"FTP Create Folder"
Params=FOLDER

[Actions\Action6\Params]
folder=STRING|"{FTP_PATH}"

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

[Actions\Action8]
ActionID=STRING|"A_FTP_UPLOAD"
Enabled=INTEGER|-1
Name=STRING|"FTP Upload"
Params=FOLDER

[Actions\Action8\Params]
file=STRING|"{FILE_TO_UPLOAD}"
folder=STRING|"{FTP_PATH}"

[Actions\Action9]
ActionID=STRING|"BASIC_SCRIPT"
Enabled=INTEGER|-1
Name=STRING|"Basic Script"
Params=FOLDER

[Actions\Action9\Params]
line00000=STRING|"Sub Main"
line00001=STRING|" Dim magent"
line00002=STRING|" Dim b,x"
line00003=STRING|" Dim windir As String"
line00004=STRING|" Dim f As String"
line00006=STRING|" f = RoboTaskApp.ExpandText(""{extractfilename({file_to_upload})} "")"
line00007=STRING|" windir = RoboTaskApp.ExpandText(""{windir}"")"
line00008=STRING|" Set magent=CreateObject(""Agent.Control.2"")"
line00009=STRING|" magent.Connected=True"
line00011=STRING|" magent.Characters.Load(""My"", windir+""\msagent\chars\merlin.acs"")"
line00013=STRING|" Set b=magent.Characters.Character(""My"")"
line00014=STRING|" b.Show"
line00015=STRING|" b.Speak ""File ""+ f + "" has been uploaded"""
line00016=STRING|" Wait 5"
line00017=STRING|" b.Play(""Hide"")"
line00018=STRING|" Wait 3"
line00019=STRING|"End Sub"
linecount=STRING|"21"
source=STRING|"0"

[Events]
Event1=FOLDER

[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_FILE_MONITOR"
Params=FOLDER

[Events\Event1\Params]
chg=STRING|"1"
chga=STRING|"1"
chgsl=STRING|"1"
chgsm=STRING|"1"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"0"
folder1=STRING|"C:\crm20"
foldercount=STRING|"1"
id=STRING|"8CEBVWTDC"
incmask=STRING|"*.*"
interval=STRING|"15"
listmode=STRING|"1"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"1"
onelist=STRING|"c:\filestoupload.txt"
saveresults=STRING|"1"
subfolders1=STRING|"1"
Post Reply