Move a folder after unzipping its contents

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Move a folder after unzipping its contents Tue May 21, 2019 1:21 pm • by shandy2
I'm trying to do the following:

1. Monitor folder 'Receipts' for any new subfolders
2. If a new sub-folder appears, check its contents for zipped files, and, if they exist, unzip them
3. Regardless of whether a zip file was found in step 2, move the sub-folder (including all its contents) to set destination

I can accomplish steps 1 and 2. The problem is that rule 3 applies to the subfolder, not just to its contents. This means the rule doesn't get executed because rule 1 is 'Run rules on folder contents'.

Help!
Last edited by shandy2 on Wed May 22, 2019 10:54 am, edited 1 time in total.
shandy2
 
Posts: 8
Joined: Tue May 21, 2019 1:13 pm

You may need to re-order the rules. Try using the rule status (the eye button) to see how the files match up and adjust accordingly.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Move a folder after unzipping its contents Wed May 22, 2019 12:13 pm • by shandy2
Mr_Noodle wrote:You may need to re-order the rules. Try using the rule status (the eye button) to see how the files match up and adjust accordingly.


I've done a bunch of tinkering, watched the log carefully, and cannot get this to work. I've tried:
- Reordering the rules
- Inserting Applescript to introduce a delay between the rules (see thread here: viewtopic.php?f=4&t=1517)
- Inserting Applescript in the third rule to force it to process the parent folder
- fiddling with the 'Copy Folder structure' options in the move action

Every experiment I've tried results in one of the following:
1. File is unzipped, but folder isn't moved
2. Folder is moved, but zip file isn't unzipped
3. One file is moved, but the the zip file isn't unzipped or moved
4. Nothing is unzipped or moved

https://imgur.com/a/pWJVhM8
shandy2
 
Posts: 8
Joined: Tue May 21, 2019 1:13 pm

shandy2 wrote:
Mr_Noodle wrote:You may need to re-order the rules. Try using the rule status (the eye button) to see how the files match up and adjust accordingly.


I've done a bunch of tinkering, watched the log carefully, and cannot get this to work. I've tried:
- Reordering the rules
- Inserting Applescript to introduce a delay between the rules (see thread here: viewtopic.php?f=4&t=1517)
- Inserting Applescript in the third rule to force it to process the parent folder
- fiddling with the 'Copy Folder structure' options in the move action

Every experiment I've tried results in one of the following:
1. File is unzipped, but folder isn't moved
2. Folder is moved, but zip file isn't unzipped
3. One file is moved, but the the zip file isn't unzipped or moved
4. Nothing is unzipped or moved

https://imgur.com/a/pWJVhM8


- I've also added "Continue matching rules" actions to each of the rules
- I've tried using the AppleScript suggested by Mr Noodle in this thread:https://www.noodlesoft.com/forums/viewtopic.php?f=3&t=135#p1545

Still can't get it to work...
shandy2
 
Posts: 8
Joined: Tue May 21, 2019 1:13 pm

Problem is that you don't have any conditions which specify when to move the folder so it depends on rule ordering.

Try something like adding a tag to the folder after unarchiving. You can try adding it to the unarchive rule. Then add a condition to the move rule to check for that tag. Note that you will need to re-order the rules such that the move rule comes before the subfolder one.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support