r/applescript • • Mar 19 '22

delay applescript from actioning?

Hello!

I have a desktop folder that we export images to with an action attached to find/replace certain characters.

I have a suspicion that the folder action is causing a conflict with our photo software resulting in some images not being exported.

I was wondering is there a way too delay the action from starting to allow the time for the software to finish the export and then start the find/replace?

1 Upvotes

13 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Mar 19 '22

Actually a quick fix:

Insert `delay nn` (where nn is seconds to delay) at the top of your script after: `on adding folder items to theAttachedFolder after receiving theNewItems` or equivalent.

You'll need to find a balance between the time it takes to write the file and waiting too long, but it will certainly fix the problem.

1

u/[deleted] Mar 19 '22

Appreciate that! Cheers.