Autosave Application

Hello to everybody,
here i am again, after a long time of abstinence


on idle 
        tell application "System Events" 
                delay 4 
                --      tell application x to activate 
                keystroke "s" using command down 
                delay 5 * minutes 
        end tell 
end idle 

it’s fully functional, but it’s only a script. (without
response on “quit”- only the shell “killall x” -command quits this
littel application)
…i want to set a bit more things:

-a list of timeouts (min, sec)
-a list of applications to include/ exclude
-special keystrokes (like ctrl+“s” for Gimp…)
(to memorize in a preference file)

in form of help or some tutorials, whose explains the construction of a universal binaries with Xcode


on idle
tell application "System Events"
	tell (processes whose frontmost is true) to set x to name
	set time_1 to delay 5 * minutes
	set time_2 to delay 10 * minutes
	--set time_3 to delay 15 * minutes
	set key_1 to keystroke "s" using command down
	set key_2 to keystroke "s" using ctrl down
	if x is in "X11" then
		delay 4
		delay 4
	end if
end tell
end idle

how can i find the frontmost app?
The SimplySave app must run in backround, but how ?..

Looks like you already know:

tell application "System Events"
	tell process (frontmost of every process)
		keystroke "w" using command down
	end tell
end tell

I’m not here to loss time with your bad quote!
all what i do is write applescripts, not xcode projects, but this must not rest so.
Any ideas, suggestions, tutorials on how write xcode, are welcome.

I am sorry I do not mean to offend you or waste your time. I tried a simple script of the code I posted and it worked for me.
Sorry but I realize a language barrier may be hindering the understanding.


Hi Joy. Learning applescript studio is not something anyone can teach you. The bad news is that it’s more complicated than can be explained here. The good news is that Apple has already given you the tools to do learn it if you have the developer tools installed. Just open the xcode application and open the help documentation under the help menu. Search for the following 2 things and read them. Make sure you are searching by “title”.

  1. Applescript Studio Programming Guide
  2. AppleScript Studio Terminology Reference

The other help they give you is example projects. The examples are located in Developer/Examples/AppleScript Studio/. Open any of the projects and look at the code.

i’m not offended.
But you script suggests me, the reader, to close my windows and “to go home” with my simple script- construction, which it is.
(my english is not so good, but here is not a language barrier to hinder the understanding)
In second case it’s one of your experiments, it isnt a reponse to my post. Here we go.

Thanks for the compass, regulus6633.
I’ve installed the Xcode tools been for a long time, but all these instruments confuse me still much.
(i hope that i can continue to write apprescript as usual, to introduce myself better into xcode. I use the Script editor every day, its essential for me.)