Trigger script upon window close

Get help with using AutoHotkey and its commands and hotkeys
hannahelappin
Posts: 53
Joined: 01 Jun 2019, 09:02

Trigger script upon window close

13 Sep 2019, 09:51

Hi,

In some accountancy software Ive set up a kit price of different sizes. Functionality in software to recall different kit sizes (sales invoices)...saves keying all prods individually. However, doesnt pull through any amended ind component prices that have changed since kit was set/up memorised. To bring prices through have to refresh customer name box, by clicking once aftr Ive recalled kitsize/invoice.

Need a script to no when Recall button has been clicked, slected said kit and then closed said window....so then automatically clicks customer name box, refreshes it to bring through current prices.

;So trigger script once window title "Recall" has been closed. Can write the rest of the script to click the button and refresh.

Many Thanks
hannahelappin
Posts: 53
Joined: 01 Jun 2019, 09:02

Re: Trigger script upon window close

13 Sep 2019, 10:10

Hi, was thinking of that. But if im doing a normal invoice e.g. not recalling one, (& never opening or closing that "Recall" Window title)that window will not be active and the following script Imake will be triggered....and I dont want/need that box refreshing for no reason only if that recall button has been clicked, Window "Recall" has been opened then "load button" clicked and window title "Recall" then gets closed.............and only then click customer button and refresh.

Might be me misunderstanding the if winnotactive command.

Rushing a bit now while im at work. I'll try and explain myself better later after work with screen shots etc.

Many Thanks
ilhom
Posts: 52
Joined: 19 Aug 2019, 17:58

Re: Trigger script upon window close

13 Sep 2019, 11:51

I think I understand better now.

Code: Select all

;Normal invoice script here

IfWinActive, Recall
{
    ;Perform actions in Recall window
    WinWaitNotActive, Recall
    ;Perform actions when Recall window is closed
}

;Continue normal invoice script here
hannahelappin
Posts: 53
Joined: 01 Jun 2019, 09:02

Re: Trigger script upon window close

16 Sep 2019, 03:03

Hi, thanks for the above.

Still need help sorry..I know im rubbish!

Step 1 ive opened new invoice option.
Screenshot 1.png
Screenshot 1.png (67.74 KiB) Viewed 485 times
Step 2 ive clicked the recall option (to select saved invoice)
Screenshot 2.png
Screenshot 2.png (39.37 KiB) Viewed 485 times
I've then selected my saved invoice from list. And then select by double clicking the line or clicking Load button.

Bring my selected invoice in.
Screenshot 3.png
Screenshot 3.png (72.02 KiB) Viewed 485 times
Now need to click A/C box delete the "e" from "CASHSALE" and then press enter. Doing this will pull through any price changes that ive made to prods after setting up the saved invoice to recall. Software is rubbish and doent account for this so this is the only work around.

So i want the script to trigger when an invoice is double clicked in the Recall window or the Load button is selected in the Recall window. Either of these selection option automatically closes the Recall window and loads the invoice. At this point I'll insert script to click the A/C BOX click delete once and then enter to pull though the prices.

Thanks for your patience & apologies if your orior answer would work in tis instance but Ive not though it through.

Many thanks
hannahelappin
Posts: 53
Joined: 01 Jun 2019, 09:02

Re: Trigger script upon window close

07 Oct 2019, 09:42

Any ideas guys? Will window wait close work...Ive read the tutorial material but struggling a fair bit.

ManyThanks

Return to “Ask For Help”

Who is online

Users browsing this forum: assak123, Bing [Bot], Chunjee, freespacing, malcev, marwanco and 142 guests