-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fswatch command fires multiple events for a single move operation #312
Comments
UPDATE: Upon further testing, I have more clarity about the issue. Whenever the file is imported into Photos, a new event is sent (and captured) by fswatch, so it gets triggered again. |
Now, the act of importing into Photos doesn't trigger an event that could be captured by fswatch, and also doesn't trigger duplicated events. Not sure what happened. I am closing this issue. |
I am reopening the issue because the problem persists. I tried with Preview app, and I get duplicated events again. |
I have encountered something similar. Here is what I found. System: MacBook Air M1, Sonoma 14.2.1 We want a file path whenever a file is created in the watch folder. Here is a dirt simple script that shows we are getting the file paths we want.
Execute the script.
In another terminal, drop some files, delete them, create and remove a directory.
Output
Good news! We are getting the file paths we want. The other paths (from removing files, directory stuff) can be filtered out with an event mask and/or filtering. Now let's open these image files with the default application (Preview). Add this line below the echo command in the loop. Copy one file into our
Boom. Although only one image is opened by Preview, the script loops until we abort it (similar to the OP). I tried various combinations of the What DOES work is viewing the image with the NOTE: To use For the next tests, I just looked at the raw For the
For the
Summary
|
Hello, and thank you for this amazing tool
I have a photos.sh file (
osascript
set toJavaScript
):and, the following test.sh file:
I execute
test.sh
in Terminal. With that process open, whenever I move a single photo into fp folder, the same photo is imported multiple times intoPhotos
app. Then, I have to kill the process.Do you know how can I fix this issue, and import a single photo corresponding to a single move operation ? Is there something wrong with my code ?
Specs:
MacBook Air M1 with macOS Ventura
The text was updated successfully, but these errors were encountered: