Here is the code that I place inside the stack for displaying the time that has elapsed since the last save. It works by getting the modification date of the file on the drive and using an algorithm to calculate the time lapse. The time lapse will be displayed in the title bar of the project in a Days:Hours:Minutes:Seconds format. To do this I used a function that I have written named HMS(). I placed it in the stack to be called by the showLastUserSave (shown below). You can find the HMS() here.
A timer loop can be used to constantly call showLastUserSave to tick away the time or if you rather not use a timer, you can just use the mouseMouse subroutine in your stack to call it everytime you move your mouse.
The mouseMove in the stack calling the showLastUserSave
Here you can see in the title that it has been over 42 minutes since I last saved my experimental app.
Here is the code to display the time lapse since the last save in the title bar
on showLastUserSave
## This will show the Days:Hours:Minutes:Seconds since the last save in the title bar of the stack. To do this, this code...
##...calls another function named HMS() I have written. You can find it on my website within the LiveCode section at:
##... https://sites.google.com/site/ongytenes/code/livecode/livecode-function-to-convert-seconds-to-hoursminutesseconds
##...Once the project is finished, you can remove this and all backup code and restore the title bar to the proper title.
set itemDelimiter to "/" #Use for Linux paths
--set itemDelimiter to "\" #Use for Windoze paths
put the filename of this stack into stackPath # Put stack's path & name into stackPath
put last item in stackPath into stackName # Store stack's name
delete last item in stackPath # Remove name from path
put files(stackPath,"detailed") into theFiles # Get list of files with details
put lineOffset(stackname,theFiles) into los # Get the Line Offset for stack file within the list
set itemDelimiter to comma # Switch the item delimiter to comma to filter file details
put line los of theFiles into fileDetails # Get current stack file details
put item 5 of fileDetails into modDate # Get last modification date for the stack
put internet date into now # Place the current time into a variable named now
convert now to seconds # Convert the current time to seconds
put (now-modDate) into timeLapse # Get seconds since the last save
set title of this stack to hms(timeLapse) # Calls the hms() function to format the seconds since last save to...
#...a Day:Hour:Minute:Second and display it in the title.
end showLastUserSave
on timeLapseTimer
showLastUserSave # Call routine to display the time lapsed
send "timeLapseTimer" to this stack in 1 second # Recursively call this subroutine every second.
end timeLapseTimer