Page 1 of 1

Work problem

Posted: Wed Feb 08, 2012 11:45 am
by bokaking
Here's a thing. I need a few things to someone help me with
RT!!!

Recive mail, download att, its a jpg with 23 characters..
like this(karton_5650000000000000) the first 10 characters
are always the same. Whet it dl the file it needs to chk if
its the right name and then upload it to FTP server, if
it's not the right name it need to delete file and send
mail to sender with message that the att. is not valid?

Please help me with this>>>THANKS!!!

Work problem

Posted: Wed Feb 08, 2012 12:08 pm
by Oleg
You should use regular expression in order to check validity of file name.

See the example below:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1597096124
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task1149"
Hide=INTEGER|0
ID=INTEGER|488809097
LocalVariables=STRING|"filename,valid"
LogOnAsUser=INTEGER|1
Name=STRING|"Check filename"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

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

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""FILENAME"" with value ""kaRTon_5650000000000123.jpg"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varname=STRING|"FILENAME"
varvalue=STRING|"kaRTon_5650000000000123.jpg"

[Actions\Action2]
ActionID=STRING|"A_REGEXP_MATCH"
Enabled=INTEGER|-1
Name=STRING|"RegExp Match"
Params=FOLDER

[Actions\Action2\Params]
anchored=STRING|"0"
case=STRING|"0"
extended=STRING|"0"
line00000000=STRING|"{filename}"
linecount=STRING|"1"
multiline=STRING|"0"
noautocapture=STRING|"0"
pattern=STRING|"(?i)^karton_565[0-9]{13}.jpg$"
savesubexpression=STRING|"0"
singleline=STRING|"0"
subexpressionpos=STRING|"0"
ungreedy=STRING|"0"
useexternal=STRING|"0"
variable=STRING|"valid"

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

[Actions\Action3\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"{valid}"

[Actions\Action4]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""File name {filename}"""
Params=FOLDER

[Actions\Action4\Params]
icon=STRING|"1"
msg0=STRING|"File name {filename}"
msg1=STRING|"is valid"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"

[Actions\Action6]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""File name {filename}"""
Params=FOLDER

[Actions\Action6\Params]
icon=STRING|"3"
msg0=STRING|"File name {filename}"
msg1=STRING|"is INVALID"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"

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

Work problem

Posted: Tue Feb 14, 2012 4:45 am
by bokaking
thanks, I have one more question... is there a way to DL
mail attachment?

Work problem

Posted: Tue Feb 14, 2012 5:44 am
by Oleg
You can download the email message from POP3 server and extract attachments from it.
Look at Email group