It seems you would need a process that runs independently of Photoshop. That process could be written in vb.net for example.
It would:
1. Montior the folder you set it to
2. Check files for the archive bit being set
3. If the files archive bit is set, then send it to
Photoshop and execute the action you are referencing.
4. Upon successful completion of the action, reset the archive bit
5. Continue monitoring.
You could also reference the last modified date of the file instead of the archive bit but it would seem you would need to keep track of the last modified date and compare it to the present, only sending those files which have a modified date later than they one you have saved for it. After successful completion, save the new modified date. This approach would require a database of some type to keep the information about the files.
You might also be able to use a file system watcher to monitor events but that has it's issues too and probably also would require a database.
I have written many processes that do most of the above over the years.
A possible routine in vb.net to do what you want could be:
Private Sub FileSystemWatcher1_Changed(ByVal sender As System.Object, ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Changed
If e.ChangeType = WatcherChangeTypes.Changed Or e.ChangeType = WatcherChangeTypes.Created Then
Dim appRef As New Photoshop.Application
Try
appRef.Open(e.FullPath)
Catch ex As Exception
MessageBox.Show("Error on attempted file open: " & ex.Message & vbCrLf & e.FullPath)
End Try
appRef.DoAction(Actionname, Actionset)
End If
End Sub
The issue with this is that if this process wasn't running when a change occured to a file it would probably get missed. Hence the need for a database and an enumeration of the files present in the watched folder to check their last modified date against a known date saved in a data base.
Regards
George Smith