Save and Close File

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Aozero1
Posts: 3
Joined: 18 Apr 2018, 21:34

Save and Close File

25 Apr 2018, 19:40

I want save and close file,because the time is different for save,I failed.
My script is:
sendinput,^s
sleep,500
send,!{space}c
sleep,500
return

Please give directions,thanks!
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Save and Close File

27 Apr 2018, 16:48

Hi.
Years ago, I had a similar problem. I solved it more dirty than quick, by checking with FileExist()
For example:

Code: Select all

myFile := "c:\Data\myTextFile.txt"
sendinput,^s
sleep,500
loop 10
{
	if !FileExist(myFile)
	sleep 300
	else
	break
}
if !FileExist(myFile)
{
	Msgbox Error. File could mot be saved.
	return
}
send,!{space}c
sleep,500
return
As I don't know, which program you use, I can not give more reliable support.
Maybe when you are working with MS Word, there are strongly reliable COM-functions you should not neglect.
Sometimes you can even use WinMenuSelectItem to select commands from the used program.

Without more information, this is everything I can do for you.
As engineers say: Less in, less out.
Give me more input, and more output could be possible. :shock: :lol: :lol:
Einfach nur ein toller Typ. :mrgreen:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], ReyAHK, Rohwedder and 252 guests