Page 1 of 1

Move a folder after unzipping its contents

PostPosted: 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!

Re: Move a folder after unzipping its contents

PostPosted: Wed May 22, 2019 10:53 am
by Mr_Noodle
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.

Re: Move a folder after unzipping its contents

PostPosted: 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

Re: Move a folder after unzipping its contents

PostPosted: Thu May 23, 2019 4:43 am
by shandy2
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...

Re: Move a folder after unzipping its contents

PostPosted: Thu May 23, 2019 10:14 am
by Mr_Noodle
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.