Check if the file exist with applescript

How do you check if a document has been saved into a file? or rather check if the document is new and has not been saved. If I use this:

set theFileAlias to (the key file as alias)

I get an error dialog “Can’t complete this command. -1404”.
If I trap the error in a try/on error statement the dialog is still displayed and the user must click cancel before the error is caught.

Any ideas would be appreciated?
Thanks.


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There isn’t a specific property for this so I’d guess you method is as good as any. It’s should probably be considered a bug that you get an error for this. A better response might be to return and empty string or something like that.


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for that Nick, I appreciate the work you are doing. The ability to script frequently performed tasks in Intaglio is really saving us alot in design time. This is not a “show stopper”.

Keep up to good work

Rob


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Have you considered using ‘doscript’ in AppleScript to get BASH(1) to test for the existence/age of a file?

Charles


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options