How do I read the full path to a file, & recreate path?

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

Moderator: Mr_Noodle

After renaming each new scanned pdf, I move the file from my scanned documents folder to the appropriately named folder for that file. The folder structure is complex and deep, like the roots of a tree. Many of the underlying folders are fairly ancient and no longer used.

I now want to start a new folder structure on a different drive, but I don't want to copy the entire structure, nor any of the old files.

What I want to achieve is to add a new rule, applicable to any new file that is scanned in future to the old structure, which will create the same path on the new drive.

For example, if a file's path is like this:

OneDrive/Banks/Citibank/Account 123456/statements/2018/December/Citi-1123456-statement-Dec-2018.PDF

I would like to have a rule which reads the path to the file called "Citi-1123456-statement-Dec-2018.PDF" and makes a new path on a different drive like this:

iCloud/Banks/Citibank/Account 123456/statements/2018/December/Citi-1123456-statement-Dec-2018.PDF

in other words, the OneDrive would have all the old and new files, but the iCloud drive would contain only the new files, without the redundant folder structure, except the necessary part.

So in simple terms, how do I read a file path into Hazel, and use that to create a similar file path elsewhere?


I know this must be covered already in these forums, or in the instructions. I have spent some time hunting around but couldn't seem to find the same question as below: If it has already been answered, just point me to the correct post, or cut and paste the reply here. many thanks.
Trickyt57
 
Posts: 55
Joined: Tue Sep 18, 2018 12:17 am

When copying/moving, you have the option of copying over the folder structure. Give that a shot.

Also, please don't post Hazel issues in the Site forum. That is specifically for issues with the site or forum.
Mr_Noodle
Site Admin
 
Posts: 11235
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:When copying/moving, you have the option of copying over the folder structure. Give that a shot.

Also, please don't post Hazel issues in the Site forum. That is specifically for issues with the site or forum.


Thanks @Mr_Noodle. apologies if I posted in the wrong place. This post now appears to be located in the section "Hazel - Support", so I guess you have moved it to the right place for me. I should point out that if you are doing a Google search for a solution to a Hazel problem, you will land on the place where I posted - which is called "Forum/Site discussion" It is far from obvious that it is only for issues about the site. To my mind,the word "Forum" would encompass a discussion about Noodlesoft products. I don't see any link referring to Hazel itself. To make it more obvious that it is not the right place I would add an extra "For questions or discussions about Hazel, please click this link."

As for the solution, I can see that works (click on the (i) Options next to the destination folder and select "Copy folder structure"). However it copies too much of the directory. The new path starts with "icloud/volumes/Secombe/,MyName/Onedrive What if I only want to copy the the directory structure from a certain point?
Trickyt57
 
Posts: 55
Joined: Tue Sep 18, 2018 12:17 am

You can specify "monitored folder" to only copy the part from the folder being watched by Hazel.

BTW, I can't control what Google shows but if you look at the forums here, https://www.noodlesoft.com/forums/ , you can see descriptions of each one.
Mr_Noodle
Site Admin
 
Posts: 11235
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support