Hi all,
As I’m not a coder and try to be familiar with scripting of Mikrotik I have a request for help. I try to use the internal FTP server of Mikrotik with a device that can upload to FTP a pdf file.
when new file uploaded I like to trigger another script and send this file by email. The file name of the uploaded file changes every time, so somehow mikrotik should read the specific folder (for example: uploaded) and send this file. When email sent, file should be deleted.
It is for a project for monitoring polution on air. the logger produce a pdf. So helping, is performing something about enviroment. 
Please Help!
Well,
I suppose no one was interest for helping enviroment. 
After long search I found that using the following code can trigger a script if new file was detected. Of course you can add some extras and boost the code
global files
local file [len [file find ]]
# Print on log the number of files and the previous value
# /log error "$files"
# /log error "$file"
if ($files<$file) do={
:global files $file
/log error "new file uploaded"
:delay 3s
system script run "New_PDF"
} else={
# /log error "no new files"
:global files $file
}
I suppose even Mikrotik Qualified Engineers do not have a deep knowledge of Scripting on RourerOS. It is pitty as Mikrotik has a big pontential not only as router equipment but also as a middleware in mobile solutions.
IMHO, I like to see mikrotik add more file management procedures, functions and tools for coding (for example an tool that can test scripts on windows/linux without the need of Routerboard hardware).
BUT the most important is that the is a lack of scripting language manuals (not just wiki) that can be go deep into the possibilities and build services as ftp->email, file->cloud, rss->file, log->IFTTT, IFTTT->script and so on.