smud Posted September 20, 2018 Share Posted September 20, 2018 I've created a script that guides me through tasks that I should do every day (ex: check email, open music). After each task, a dialog pops up with Yes or No. If I click Yes, it needs to be marked as done for Today only. If I click no, it won't be marked as done for today. Meaning if I run the script again, it will only do the tasks that weren't done (clicked no) How would I go about doing this? Link to comment Share on other sites More sharing options...
spudw2k Posted September 20, 2018 Share Posted September 20, 2018 So essentially, you need to save the result of your yes presses and have some sort of time associated with it? There are many ways to do this: you could save the data to a file or the registry for example. Each solution has their place and ideal scenario, but depending on the requirements, one solution may be more appropriate than others; for example: a registry solution may be most appropriate for a single specific computer, a local or network file solution may be appropriate for a mobile solution, a centralized network database solution could be best if needing to track multiple machines with multiple users. So, what are your requirements? Some functions to explore in your help file. Might give you some initial ideas. RegWrite FileWrite IniWrite _DateDiff FrancescoDiMuro 1 Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
smud Posted September 20, 2018 Author Share Posted September 20, 2018 Thanks for the info so far. I'm reading up on RegWrite right now. Basically, I only want to do each task (dialog box) once per day. If I already clicked Yes today, it won't show up again, even if I restart the script or my computer. I was thinking of writing to Excel but that seems far too complicated for me as I'm not well-versed in programming. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted September 20, 2018 Share Posted September 20, 2018 @smud As @spudw2k suggested, you could easily do an Ini file, in which you put all your tasks as sections, and a key to mark if you already did that operation or not An easy "format" of the Ini file could be: [TaskName] Done=Yes ;No Look at Ini* functions in the Help file. Then, at the start of your script, you have to read all the sections in an array, and obtain the values of the Done key, in order to let the script asks you if you want to do a certain operation or not. When you are prompted with that question, and you click on "Yes", then you simply use an If...Else...EndIf statement, and, in case of $IDYES, you write Done = Yes to the specific section, so you don't have to worry if you restart your script in the same day. By the way, you should think to reset your Ini file everyday, or you are not going to be asked to do something anymore Try those functions and let us know Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
smud Posted September 20, 2018 Author Share Posted September 20, 2018 Thank you guys! Got it working. (except the date comparison, but np). Local $sRead = IniRead("Z:\Automation" & "\JustDoThis.ini", "General", "Music", "Default Value") If $sRead == "No" Then If MsgBox(4, "4 Minutes", "Play Music") = 6 Then IniWrite("Z:\GoogleDrive\Work\TrueAutomation\_Just Do This" & "\JustDoThis.ini", "General", "Drums", "Yes") Else IniWrite("Z:\GoogleDrive\Work\TrueAutomation\_Just Do This" & "\JustDoThis.ini", "General", "Drums", "No") EndIf EndIf Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted September 21, 2018 Share Posted September 21, 2018 @smud For the date comparsion, you could easily save: - or the last access to the task, and so, you would have another key for each section you have; - or the last access to the file, and so, you would have only one section, plus your tasks, in which you save the last time you access "by script" the file As @spudw2k suggested, look at _Date* functions, especially at _DateDiff() Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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