I have folder that will get textfiles wich I want to present to the user. But only when the user have the application started.
I done this so far:
3 functions---- (function Main is the function that runs when you start the appliction)
- Start a gui part that is just a windows that says “ALERTS” (created with primal forms)
- Starts the function “PollAlerts”
- Searches a directory / folder after new files
- When it find a new file it start function “SendMessage” with the containt of the file as message.
- writes a .hash files that contains the md5sum for the file so it wont send it to “SendMessage” function again
- get the message to send from $args and then creates a pop-up message with the help of gui that I created with primal forms
- When the users clicks the button “markera meddelandet som läst” the scripts writes to the log and closes the pop-up
And som more logging… and stuff.
My problem is this:
The first gui parts hangs when the monitoring beginns. How should I do to seperate that part and still close it when the gui closes?
-Tried start-job but then the script can’t create the pop-up message.
-Tried to seperate the “monitoring” to another script and start it from the main script with “start-process”. Then it does not work either…
What to do??