After a project is opened and I have done some changes, I want to start the build or code generating process by a python script file. After the build is done I a Windows sound/beep should appear. Anyone has an example or hint how the .py file has to look like? Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
# i-campbell 2024importsubprocessfromscriptengineimport*# with a project already open# save if not yet saved# check pool objects if it is a library# generate code only for the active application if it is a project# beep thanks to https://devblogs.microsoft.com/scripting/powertip-use-powershell-to-send-beep-to-console/ifprojects.primary:# check project is openifprojects.primary.dirty:# saveprojects.primary.save()ifprojects.primary.path.lower().endswith('.library'):projects.primary.check_all_pool_objects()# check all pool objects for libelse:projects.primary.active_application.generate_code()# generate if not lib# note, there could be more applications than the active application,# this script does not generate thoseelse:system.write_message(Severity.Error,'no project open')ps_output=subprocess.check_output(["powershell","-Command","[console]::beep(500,300)"])# beep
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thank you very much! I found the generate_code methode, but struggled with the primary and active_application. With this expample I will be able to play around. If the code generation takes a minute or more I often switch to other programs and don't notify the process is finished. So now I'll get an alert and will switch back immediately. My next little project will be, to beep different if there are errors and a seperate script to do the download incl. the user management data base without stopping at the dialogs asking for onlinechange/complete download and overwriting an existing database and as goody, play a beep/sound again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After a project is opened and I have done some changes, I want to start the build or code generating process by a python script file. After the build is done I a Windows sound/beep should appear. Anyone has an example or hint how the .py file has to look like? Thanks!
hello, please enjoy.
thank you very much! I found the generate_code methode, but struggled with the primary and active_application. With this expample I will be able to play around. If the code generation takes a minute or more I often switch to other programs and don't notify the process is finished. So now I'll get an alert and will switch back immediately. My next little project will be, to beep different if there are errors and a seperate script to do the download incl. the user management data base without stopping at the dialogs asking for onlinechange/complete download and overwriting an existing database and as goody, play a beep/sound again.