Skip to main content
May 20, 2013
Answered

Check a file's save status.

  • May 20, 2013
  • 1 reply
  • 515 views

Ok, this seems like it should be simple, but I'm trying to do a simple check if a file has been saved or not at the beginning of my applescript. 

I tried just putting a consistent save at the beginning, but I'm working with big files and if they've already been saved it's a big waste of time to sit there and wait for them because they always save. 

The basic set up i want is:

if theFile is not saved

     save theFile

else


end if

i just cant figure out the wording and I cant find it in any of the references.

This topic has been closed for replies.
Correct answer

Found it:

set saveState to modified of current document

if saveState is true

save current document

else

end if

1 reply

Correct answer
May 20, 2013

Found it:

set saveState to modified of current document

if saveState is true

save current document

else

end if