KickStarter15 Posted February 18, 2017 Share Posted February 18, 2017 (edited) Hi Experts, I need your inputs and idea if can autoit notify the user if has new file saved in his/her folder? Like to loop in that folder and popup notification GUI (see sample attached). I've got it from google. I can't start compiling code from this point. I have no idea how to handle notification. I also tried help but it's different of what i've expected to do. Any help and idea would be great from experts on this forum. I'm kind of new learner in autoit and this forum helps me a lot. Hope you can extend your support for a seeker like me. Thanks in advance guys.... Edited February 21, 2017 by KickStarter15 Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 18, 2017 Moderators Share Posted February 18, 2017 (edited) KickStarter15, I have used the FileSystemMonitor and ReadDirectoryChanges UDFs to monitor folders for changes. My personal preference goes to the former as it is self-contained while the latter requires a DLL. As to the pop-up notification, look at my Toast & Notify UDFs (links in my sig below). M23 Edited February 18, 2017 by Melba23 Fixed links KickStarter15 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
KickStarter15 Posted February 18, 2017 Author Share Posted February 18, 2017 Hi M23, Thanks for your help, i finally got the idea how but I coded it my self and compiled some codes from help and your Notify UDF, and I've got the result I need. Big big appreciation with your coding M23 and If you have any modification of what i coded below that would be helpful. expandcollapse popup#include <WinAPI.au3> #include <GUIConstants.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <IE.au3> #Include <File.au3> #Include <Array.au3> #include <DateTimeConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate(@UserName, 190, 350, 192, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore") $Label1= GuictrlcreateLabel("0",0,0,0,0) GUICtrlSetOnEvent(-1, "Label1Click") $List1 = GUICtrlCreateListView(" |", 3, 30, 179, 293,$LVS_NOCOLUMNHEADER,$LVS_EX_FULLROWSELECT) GUICtrlSetOnEvent(-1, "List1Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Func popup() $popup = GUICreate("New file saved to folder...", 350, 30, 1020,960, $WS_POPUPWINDOW) GUISetOnEvent($GUI_EVENT_CLOSE, "popup") $Label = GUICtrlCreatelabel("New file saved to folder...", 1, 1, 250, 23,-1) GUICtrlSetFont(-1, 12, 800, 0, "Arial") GUICtrlSetColor(-1,0xFFFFFF) GUICtrlSetBkColor(-1, 0x3D95FF) GUISetState(@SW_SHOW) WinSetTrans("New file saved to folder...","",255) sleep(1000) WinSetTrans("New file saved to folder...","",240) sleep(200) WinSetTrans("New file saved to folder...","",230) sleep(200) WinSetTrans("New file saved to folder...","",220) sleep(200) WinSetTrans("New file saved to folder...","",210) sleep(200) WinSetTrans("New file saved to folder...","",200) sleep(200) WinSetTrans("New file saved to folder...","",190) sleep(200) WinSetTrans("New file saved to folder...","",180) sleep(200) WinSetTrans("New file saved to folder...","",170) sleep(200) WinSetTrans("New file saved to folder...","",160) sleep(200) WinSetTrans("New file saved to folder...","",150) sleep(200) WinSetTrans("New file saved to folder...","",140) sleep(200) WinSetTrans("New file saved to folder...","",130) sleep(200) WinSetTrans("New file saved to folder...","",120) sleep(200) WinSetTrans("New file saved to folder...","",110) sleep(200) WinSetTrans("New file saved to folder...","",100) sleep(200) WinSetTrans("New file saved to folder...","",70) sleep(200) WinSetTrans("New file saved to folder...","",65) sleep(200) WinSetTrans("New file saved to folder...","",60) sleep(200) WinSetTrans("New file saved to folder...","",0) sleep(200) if WinSetTrans("New file saved to folder...","",0) then GUISetState(@SW_HIDE) EndFunc ListUser() $nFiles = "D:Programs\" & @UserName & "\Folder" $xFiles = DirGetSize($nFiles,1) GUIctrlsetdata($Label1, $xFiles[1]) While 1 Sleep(1000) local $arraynfiles = DirGetSize($nFiles,1) If GUICtrlRead($Label1) < $arraynfiles[1] then GUIctrlsetdata($Label1, $arraynfiles[1]) popup() endif WEnd Func ListUser() $FILE=_FileListToArray("D:Programs\" & @UserName & "\Folder") if @error then else For $INDEX = 1 To $FILE[0] $POINT = StringInStr($FILE[$INDEX],"_",0,-1) if $POINT <> 0 then GUICtrlCreateListViewItem(StringLeft($FILE[$INDEX],$POINT-1),$List1) endif Next endif EndFunc Func Form1Close() Exit EndFunc I tried having it that way to see if it works. When new file saved at the path "$nFiles" notification popup at the bottom of your desktop. I never expected i can compiled it that way but looks so messy at all. Anyway, am I doing it right? I'm a little bit confused with it. Please can you make it more nicer. Thanks... Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 18, 2017 Moderators Share Posted February 18, 2017 KickStarter15, Quote am I doing it right? If it works for you then the answer is : Yes! I would have done it very differently as I explained above, but that does not make mine the only solution. As to cleaning up the code - I would suggest using a loop to fade the notification: GUISetState(@SW_SHOW) WinSetTrans($popup, "", 255) ; Use the GUI handle as you have it Sleep(1000) For $iTrans = 240 to 0 Step -10 WinSetTrans($popup, "", $iTrans) Sleep(200) Next GUISetState(@SW_HIDE) EndFunc M23 KickStarter15 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
KickStarter15 Posted February 18, 2017 Author Share Posted February 18, 2017 37 minutes ago, Melba23 said: As to cleaning up the code - I would suggest using a loop to fade the notification: GUISetState(@SW_SHOW) WinSetTrans($popup, "", 255) ; Use the GUI handle as you have it Sleep(1000) For $iTrans = 240 to 0 Step -10 WinSetTrans($popup, "", $iTrans) Sleep(200) Next GUISetState(@SW_HIDE) EndFunc Wowwww... I never had it in mind that it can also be done this way... Thank you so much M23, you have made my day perfect. 40 minutes ago, Melba23 said: If it works for you then the answer is : Yes! I would have done it very differently as I explained above, but that does not make mine the only solution. Thank you M23, i think i can have it this way. Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare. Link to comment Share on other sites More sharing options...
KickStarter15 Posted February 18, 2017 Author Share Posted February 18, 2017 M23, How can I change this forum to [Solved]... Don't know how.. Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 18, 2017 Developers Share Posted February 18, 2017 5 minutes ago, KickStarter15 said: How can I change this forum to [Solved]... There is no option to click, but you could simply update the title and prefix it with [Solved] if you want. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Subz Posted February 18, 2017 Share Posted February 18, 2017 Actually I was puzzled by this as well when I first started, to update the title as Jos mentioned, you need to edit the first post. Link to comment Share on other sites More sharing options...
KickStarter15 Posted February 21, 2017 Author Share Posted February 21, 2017 Thanks, guys. Noted on this. Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now