Finding subtitles for ripped or downloaded videos isn’t terribly complicated. Most of the time it involves a quick search at sites like OpenSubtitles or Subscene for a particular TV show.
The attached script was created by merging two script ideas. The concept is to move all Airdrop files to a sub-fold 'AirDrop' in the Downloads folder automatically using the 'Folder Action' function. However, the 'Airdrop' folder must be present for that part of the script to function and sometimes, while cleaning up, I delete it along with all other downloads.
So, I added a little more code (mind you I'm an amateur at coding) to have it check for the 'AirDrop' folder and create it if missing.
This part works when I test it in Script Editor and lets me know if the 'Airdrop' folder exists and if not it is created.
When attached to the download folder as an action script the recent added code appears to be skipped. All air drop files go into the download folder or airdrop sub-folder if present but the script does appear to check for the AirDrop folder or not 'say' whether there is a 'AirDrop' folder or not. It will not create it if it is missing.
------ Added to check for and create missing sub-folder---------
On adding folder items to this_folder after receiving added_items
I would like it to run the part of the script to create the missing folder when required.
DivebossDiveboss
1 Answer
This was my resolve and gives what I wanted. Again thanks everyone that responded. This is now shown as formatted correctly. I didn't read the first time how to enter the code block on this website, so it appeared I had not formatted it correctly. That was not the case.
DivebossDiveboss
Not the answer you're looking for? Browse other questions tagged macosapplescript or ask your own question.
I have a folder that I would like to add a folder action to. The action works great when the file is added to the top level. But when a file is added to and sub-folders, the action is not enabled. Is there a way to ensure that a folder action is enabled when a file is added to any of its subfolders?
biased_estimatorbiased_estimator
1 Answer
launchd has a feature called watchpaths which can run a .sh script or whatever you please when changes occur.
depending on the security requirements of paths are you are looking to monitor and when you'd like it monitored (when logged in or always?); determines where you place the plist.