Critical buffering for just a short excerpt: How?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
blue_fields
Posts: 20
Joined: 16 Feb 2023, 11:07

Critical buffering for just a short excerpt: How?

Post by blue_fields » 24 Mar 2023, 21:35

Hey everyone,

I'm using the Adobe Acrobat COM obects inside AHK, and while these objects are communicating with Acrobat, sometimes they cannot be interrupted by hotkeys which contain other Acrobat COM functions. However, I still want the buffering of the hotkeys, so that when the original COM operations finish, the code from the hotkey will trigger immediately after.

It seems like the Critical and Thread options only work for an entire section of code, or an entire hotkey/hotstring. Is there a way to get this functionality but just on a few lines of code within my main loop? Thank you for any help you may be able to provide! 8-)

Code: Select all

avdoc := acrobat.GetActiveDoc()
pddoc := avdoc.GetPDDoc()
read_title1 := pddoc.GetFileName()
read_numPages := pddoc.GetNumPages()
avview := avdoc.GetAVPageView()
read_currentPage := avview.GetPageNum()
; must always run completely before a hotkey interrupt

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Critical buffering for just a short excerpt: How?

Post by swagfag » 25 Mar 2023, 03:48

Critical is in effect until u disable it or it gets disabled(by ahk, by virtue of the thread running to completion)
so, enable it at one point and disable it at whichever other point u like

Post Reply

Return to “Ask for Help (v2)”