Jump to content

Recommended Posts

Posted

Hi All,

I was wondering if anyone can help me - I have a situation where when running a program

from a script before exiting the program I need to check if the save message will popup or not

and if so then to save.

I know I can always save before exiting but this seems not to be good enough.

I use

send("{alt}")

send("f")

send("x")

and then somethimes I'm prompted for a save and sometimes not.

So how can I check if I was prompted for a save or not ?

Thanks in Advance

Posted

Hi All,

I was wondering if anyone can help me - I have a situation where when running a program

from a script before exiting the program I need to check if the save message will popup or not

and if so then to save.

I know I can always save before exiting but this seems not to be good enough.

I use

send("{alt}")

send("f")

send("x")

and then somethimes I'm prompted for a save and sometimes not.

So how can I check if I was prompted for a save or not ?

Thanks in Advance

What App is it?

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Posted

Hi All,

I was wondering if anyone can help me - I have a situation where when running a program

from a script before exiting the program I need to check if the save message will popup or not

and if so then to save.

I know I can always save before exiting but this seems not to be good enough.

I use

send("{alt}")

send("f")

send("x")

and then somethimes I'm prompted for a save and sometimes not.

So how can I check if I was prompted for a save or not ?

Thanks in Advance

Get the characteristics of the message window that asks for the save (title, text) and use it with the WinExists() function:

If WinExists("Save File", "Do you want to save?") Then
; Handle if it did pop up
Else
; Handle if it did not
EndIf

:o

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted (edited)

heres what i use with notepad

WinClose($LOG_TITLE)
If WinExists("Notepad", "&Yes") Then ControlClick("Notepad", "&Yes", "Button1")

edit: add attachment

Edited by pecloe
Posted

Get the characteristics of the message window that asks for the save (title, text) and use it with the WinExists() function:

If WinExists("Save File", "Do you want to save?") Then
; Handle if it did pop up
Else
; Handle if it did not
EndIf

:o

Thanks, ill try it out an hopefully it will work
Posted

heres what i use with notepad

WinClose($LOG_TITLE)
If WinExists("Notepad", "&Yes") Then ControlClick("Notepad", "&Yes", "Button1")

edit: add attachment

Thanks, ill try it out an hopefully it will work

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...