Does Applescript Finder update still exist

(Lenny Eiger) #1

I’m having lots of fun. I have a script that takes down a Helix database, makes some backups, runs it thru a checking utility and brings it back up again. Iv’e been using for years, its installed at 6 client sites. Was solid for a long time, now a bit flaky.

I am getting some errors, mostly -609 and even a -43. I quit out of the database app, want to make a copy of the database file (basic duplicate) and it can’t find the file? when I have given it the full file location as an alias?

Do I need to add extra delays or a tell Finder ‘update the enclosing folder’? Does that even work these days?

TIA. Lenny

(Shane Stanley) #2

You shouldn’t. In fact, it’s probably not a good idea under 10.13.

But Finder scripting has become slower and more painful; if you can avoid it, I suggest you do.

(Lenny Eiger) #3

Shane, thanks for responding.
I have a construct that was failing (in 13.3 and other earlier OS’es). It puts together a string of text (theString) and then there is an “if exists file theString”.
There was clearly no file in the location with that name. It kept giving me a true in the condition… until I put a “update mainLocation” command (already inside a tell Finder block) right before the if exists. Then it properly returned a false for that condition.
That’s where the -43 was coming from - it was trying to duplicate a non-existent file. Go figure.
Now I just have to solve that -609, but tis driving another app…

(Shane Stanley) #4

I’d skip the Finder for that, and use:

 theString as alias
-- it exists if you get here
on error
 -- it doesn't exist
end try