Nine Posted February 24, 2022 Share Posted February 24, 2022 Problem with a central file is that if someone is writing to it, no one can do the same. Unless there is a rigorous error handling, some updates may be lost. I suppose that is not an important issue ATM and I trust someone (like you) can manage the short term situation. But I have worked in heavy load of data (hospitals) and my first reflex is to give a robust solution. So I still wouldn't suggest to go with a DB. Since update may reduce to none over time, I believe having a shared file is your best solution in short-middle term. It will be way easier to deploy. Using the robust WinAPI, you can address the problem of multiple access and let the users wait for update of the central file. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
barkeeper Posted February 25, 2022 Author Share Posted February 25, 2022 15 hours ago, Nine said: Problem with a central file is that if someone is writing to it, no one can do the same. Unless there is a rigorous error handling, some updates may be lost. I suppose that is not an important issue ATM and I trust someone (like you) can manage the short term situation. But I have worked in heavy load of data (hospitals) and my first reflex is to give a robust solution. So I still wouldn't suggest to go with a DB. Since update may reduce to none over time, I believe having a shared file is your best solution in short-middle term. It will be way easier to deploy. Using the robust WinAPI, you can address the problem of multiple access and let the users wait for update of the central file. Well, since i can use a lot of help with achieving this solution. I’m not one to make a demand in a certain way, since we can’t handle workload everything would be acceptable, even everyone running their own program with ‘answers’ file, and sharing copy/paste answers to add to it through teams, or me making a new file every friday or weekend. We need some ‘time saver’ for the near future to keep our workload managable. i would say if the system could scan for a directory of files at the start; and document the name before the .txt or .ini as an entry to use, and show that as a searchable string, i could work with that for now already. But keeping the layout (as my example answer) without having to code things like <enter> or <bold> in it would already help a lot as well Link to comment Share on other sites More sharing options...
Nine Posted February 25, 2022 Share Posted February 25, 2022 (edited) Here a simple script that hopefully will can get you started : #include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hGui = GUICreate("Example of reading a RTF file", 1020, 650, -1, -1) Local $hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 1000, 520, _ BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) GUISetState() $sText = StringRegExp(FileRead("Document.txt"), "(?s)\[VPN\]\v*(.*)\[\/VPN\]", 1)[0] _GUICtrlRichEdit_SetText($hRichEdit, $sText) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _GUICtrlRichEdit_SetSel($hRichEdit, 0, -1) _GUICtrlRichEdit_Copy($hRichEdit) _GUICtrlRichEdit_Destroy($hRichEdit) EndFunc ;==>Example I took your example previously posted and used your idea of special tags [VPN]...[/VPN] Once you have reviewed the text, it automatically copy the text and you can paste it in an Outlook message successfully. Tested in Win7. I used Notepad++ to update the file. You just need to write your answers with my script, open the file Document.txt, add tags, paste text in between. Of course, you will need to add a more intelligent UI, but this proof of concept is working... ps. If you do not like my approach of having everything into a single txt document, you could also create a rtf file for each answers (you could use WordPad for it). And then read the corresponding document instead of extracting it. Document.txt Edited February 25, 2022 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted February 26, 2022 Share Posted February 26, 2022 (edited) Hi @barkeeper, I followed the thread (the conversation) here and found it would be helpful to contribute. I will also provide a little example like @Nine did 👍 . My approach will contain a database usage because I have a similar requirement for another project (probably with more data). This means it could be useful for me too. I try to provide basic functionality to fit your mentioned requirements (as I understood them 😅). Afterwards I will restructure the project to to meet my requirements. My implementation will take a while. So if you can not wait (few days) go ahead and try to use and expand the nice example of @Nine. On 2/25/2022 at 12:46 AM, Nine said: So I still wouldn't suggest to go with a DB. Since update may reduce to none over time, I believe having a shared file is your best solution in short-middle term. It will be way easier to deploy. Using the robust WinAPI, you can address the problem of multiple access and let the users wait for update of the central file. Yes the file approach should be easier. Regarding the possible multiple access handling, a database would do it on his own. That's why I would prefer that way 😀 . I hope I can bring a suggestion pretty soon, but don't count on it. Best regards Sven ________________Stay innovative! Edited February 26, 2022 by SOLVE-SMART barkeeper 1 Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
barkeeper Posted February 26, 2022 Author Share Posted February 26, 2022 23 hours ago, Nine said: Here a simple script that hopefully will can get you started : #include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hGui = GUICreate("Example of reading a RTF file", 1020, 650, -1, -1) Local $hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 1000, 520, _ BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) GUISetState() $sText = StringRegExp(FileRead("Document.txt"), "(?s)\[VPN\]\v*(.*)\[\/VPN\]", 1)[0] _GUICtrlRichEdit_SetText($hRichEdit, $sText) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _GUICtrlRichEdit_SetSel($hRichEdit, 0, -1) _GUICtrlRichEdit_Copy($hRichEdit) _GUICtrlRichEdit_Destroy($hRichEdit) EndFunc ;==>Example I took your example previously posted and used your idea of special tags [VPN]...[/VPN] Once you have reviewed the text, it automatically copy the text and you can paste it in an Outlook message successfully. Tested in Win7. I used Notepad++ to update the file. You just need to write your answers with my script, open the file Document.txt, add tags, paste text in between. Of course, you will need to add a more intelligent UI, but this proof of concept is working... ps. If you do not like my approach of having everything into a single txt document, you could also create a rtf file for each answers (you could use WordPad for it). And then read the corresponding document instead of extracting it. Document.txt 1.88 kB · 3 downloads I will take a look at this after the weekend, but let me start by saying i’m incredible thankful that you’ve looked into this and gave me something to start/continue on! Will keep you posted ❤️ Link to comment Share on other sites More sharing options...
Nine Posted February 26, 2022 Share Posted February 26, 2022 (edited) Well after some more thoughts, I believe the simpler and most efficient short-term solution would be to create a share folder where everybody could add their answers in RTF format. Here a revised version using this approach : expandcollapse popup#include <GUIConstants.au3> #include <GuiRichEdit.au3> #include <WindowsConstants.au3> #include <File.au3> Global Const $DOCUMENT_PATH = ".\document\" Example() Func Example() Local $aList = _FileListToArray($DOCUMENT_PATH, "*.rtf", $FLTA_FILES) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error", "No File Found") Local $hGui = GUICreate("Example of reading a RTF file", 1020, 650, -1, -1) Local $idList = GUICtrlCreateCombo("Select Answer", 10, 10, 150, 25) GUICtrlSetData(-1, ListAnswer($aList)) Local $hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 50, 1000, 520, _ BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) Local $idCopy = GUICtrlCreateButton("Copy", 10, 600, 100, 20) GUISetState() Local $sText While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idList $sText = BinaryToString(FileRead($DOCUMENT_PATH & GUICtrlRead($idList) & ".rtf")) _GUICtrlRichEdit_StreamFromVar($hRichEdit, $sText) Case $idCopy _GUICtrlRichEdit_SetSel($hRichEdit, 0, -1, True) _GUICtrlRichEdit_Copy($hRichEdit) _GUICtrlRichEdit_SetSel($hRichEdit, -1, -1) EndSwitch WEnd _GUICtrlRichEdit_Destroy($hRichEdit) EndFunc ;==>Example Func ListAnswer($aArray) Local $sList For $i = 1 To $aArray[0] $sList &= StringRegExpReplace($aArray[$i], "\..*", "") & "|" Next Return StringTrimRight($sList, 1) EndFunc There is a small bug when using WordPad, so I suggest to create/modify the RTF file with Word. VPN.rtf Edited February 26, 2022 by Nine barkeeper 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted February 26, 2022 Share Posted February 26, 2022 (edited) Hi @barkeeper, can I assume that you and your colleagues will be connected to the internet during using the program? Because I want to use a embedded editor instead of preparing the *.rtf files in WordPad or somewhere else 😀 . Best regards Sven ________________Stay innovative! Edited February 26, 2022 by SOLVE-SMART Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
Nine Posted February 26, 2022 Share Posted February 26, 2022 43 minutes ago, SOLVE-SMART said: I want to use a embedded editor instead preparing the *.rtf files in WordPad or somewhere else I am interested in that ActiveX, can you provide a bit more information about it ? I will not cut the grass under your feet.... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted February 26, 2022 Share Posted February 26, 2022 (edited) Hi @Nine, 22 minutes ago, Nine said: I will not cut the grass under your feet.... 👍 , glad to read that 😂 . Actually it's quite simple, if it's feasable 😉 . I will create a GUI, embedd an IE object, load a javascript RTF editor and interact with that editor by innerHTML object evaluation. I hope to store the format information of the editor in SQLite. I scroll through the tags and show the answer in the js RTF editor (hope so). That's it basically. Don't do this earlier 😅 , I want to do the POC. Just kidding, do what ever you want. And to be honest, I am interested in your opinion about these thoughts. Best regards Sven ________________Stay innovative! Edited February 26, 2022 by SOLVE-SMART barkeeper 1 Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
Nine Posted February 26, 2022 Share Posted February 26, 2022 That is a great idea. But I do not feel up to create such a thing. Especially if I would have to maintain it. Moreover in the long run... But I would be very interested to see and test your POC ! SOLVE-SMART 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nine Posted February 26, 2022 Share Posted February 26, 2022 @SOLVE-SMART On second thought, why do you need to create this artificial ActiveX when you could use Word ActiveX to perform exactly what you intend to do ? That seems to be a nicer way to go, no ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted February 27, 2022 Share Posted February 27, 2022 (edited) Hi @Nine, 15 hours ago, Nine said: [...] why do you need to create this artificial ActiveX when you could use Word ActiveX to perform exactly what you intend to do ? [...] I think you're right about this could be a nicer way, but I don't want to use Word ActiveX because I will need "Code" block editor format which isn't available in Word (WordPad) out of the box. In the js variant it is 😀 . Like I wrote, I will prepare something for @barkeeper, but I also focus my own requirements. Maybe I can start the implementation of the POC at todays evening - let's see (local time for me in germany now: 15:54). Best regards Sven ________________Stay innovative! Edited February 27, 2022 by SOLVE-SMART Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
barkeeper Posted February 28, 2022 Author Share Posted February 28, 2022 On 2/26/2022 at 2:02 PM, SOLVE-SMART said: Hi @barkeeper, I followed the thread (the conversation) here and found it would be helpful to contribute. I will also provide a little example like @Nine did 👍 . My approach will contain a database usage because I have a similar requirement for another project (probably with more data). This means it could be useful for me too. I try to provide basic functionality to fit your mentioned requirements (as I understood them 😅). Afterwards I will restructure the project to to meet my requirements. My implementation will take a while. So if you can not wait (few days) go ahead and try to use and expand the nice example of @Nine. Yes the file approach should be easier. Regarding the possible multiple access handling, a database would do it on his own. That's why I would prefer that way 😀 . I hope I can bring a suggestion pretty soon, but don't count on it. Best regards Sven ________________Stay innovative! Wow, that's awesome! Let's keep in touch, sure I can wait a few days/weeks, keep me posted Link to comment Share on other sites More sharing options...
barkeeper Posted February 28, 2022 Author Share Posted February 28, 2022 On 2/26/2022 at 10:54 PM, SOLVE-SMART said: Hi @barkeeper, can I assume that you and your colleagues will be connected to the internet during using the program? Because I want to use a embedded editor instead of preparing the *.rtf files in WordPad or somewhere else 😀 . Best regards Sven ________________Stay innovative! Yes we are, some restrictions on "not default" ports, but since we're IT, no issues there if it should be needed as well Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted February 28, 2022 Share Posted February 28, 2022 Hi folks, I finished the first design mockup for the answer tool, called Au3AnswerByTag. The backend code is still in progress, but I achieved the functional breakthrough 🤞 . I am already in contact with @barkeeper by private message, but I will you inform about the progress. In case your offer still exist, I will let you know when you can test the application @Nine 😀 . Image: Program opened Image: Answer displayed by chosen tag Best regards Sven ________________Stay innovative! Musashi, barkeeper and Nine 3 Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
Solution SOLVE-SMART Posted March 2, 2022 Solution Share Posted March 2, 2022 Hi folks, I completed a first version v0.1.0 of "Au3AnswerByTag". It can be visit and checked on GitHub. If you don't want to get the complete release package, just use the zip archive that is attached to this post 😉 . Only the program files are in the zip, no documents or other GitHub related stuff. Now it's time to do proper testing or at least just a review @Nine 😅 . But please keep in mind that I have to talk again with @barkeeper about the current features and possible upcoming changes. Best regards Sven ________________Stay innovative! Au3AnswerByTag.zip barkeeper, Nine, mLipok and 1 other 3 1 Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
barkeeper Posted March 3, 2022 Author Share Posted March 3, 2022 16 hours ago, SOLVE-SMART said: Hi folks, I completed a first version v0.1.0 of "Au3AnswerByTag". It can be visit and checked on GitHub. If you don't want to get the complete release package, just use the zip archive that is attached to this post 😉 . Only the program files are in the zip, no documents or other GitHub related stuff. Now it's time to do proper testing or at least just a review @Nine 😅 . But please keep in mind that I have to talk again with @barkeeper about the current features and possible upcoming changes. Best regards Sven ________________Stay innovative! Au3AnswerByTag.zip 1.22 MB · 3 downloads AMAZING! This solves my requirements, you're the best!! thank you 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