Comic Book Organization Help Requested

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

Moderator: Mr_Noodle

Comic Book Organization Help Requested Fri Jul 13, 2012 10:35 pm • by 5x5
Hi. First, thanks for any help/advice. I'm relatively clueless in this arena, so I defer to your massive, impressive hive brain.

(preamble)
I like reading comics on my iPad. I've basically moved to an exclusively digital platform. I download comics that have been scanned by various people or groups and they're tagged as such (both in the file name/folder name and with a jpg 'tag' as the last page in the issue). These are a great way of giving credit to people who put the time and effort in when they're shared and distributed. Thing is, once I get them, I don't share. They go on my HD and/or my iPad.
(/preamble)

But since I have 1000+ comics on my iPad, these tags (and sometimes other superfluous pages) are included. Even if they're 1MB each, that's 1GB+ of wasted space, which is at a premium on my 16GB iPad (next time, I'll get a bigger one. Promise). That's another 100+ issues I can keep on there in the same amount of space. These numbers are general and estimated. Could be more, for all I know.

These files are a folder containing .jpgs of the scanned pages which is compressed and renamed.

I thought Hazel could be useful to help automate this project. I need to complete several steps.
1) Unarchive the .cbr or .cbz file (these are fancy .zip and .rar files)
2) Delete the last page where applicable
3) Re-archive to .zip and rename to .cbr or .cbz
4) Rename .cbz/r file to remove scanner tags

I don't think there's much I can do about the first 2 steps; I can set up a folder where anything put inside is unarchived. But I probably have to delete the pages myself. I've set up a folder that I drop these altered folders into that will re-archive and rename and move to an 'Out' folder.

I'm stuck on the file renaming. The trick is not every file is named the same way and I'm no coder. Even the supposedly simple Apple Scripts are over my head.

Typically, the name structure is: [Series Title] [-Optional Story Title] [Issue #] [Release Year] [Scanner Tag].cbr And there's usually repeated names like Empire, Resin, Nagha, Minutemen, DCP, and so on. Some have multiples. The date and scanner tags are often in parentheses, but not always.

What can I do to automate as much of this process as possible? Again, I know this is a tall-ish order to ask of strangers, but I'm grateful for anything I can use and I appreciate your donation of time.

Thanks so much! Sorry for rambling. It's what I do.
5x5
5x5
 
Posts: 11
Joined: Fri Jul 13, 2012 10:03 pm

Re: Comic Book Organization Help Requested Tue Jul 17, 2012 3:13 pm • by Mr_Noodle
Look up "match patterns" and "custom tokens" in the help. This allows you to, well, match patterns and then create, what else but, custom tokens based on text in the original.

Also, you can use Hazel to unpack the archives. As far as deleting the last page, I have no idea how that is indicated (special filename?) so you'll have to figure that out.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Comic Book Organization Help Requested Tue Jul 17, 2012 3:29 pm • by 5x5
Thanks, Mr_Noodle. I'll check out those sections. I haven't delved too deep into what Hazel can do, so tokens and matches were something I hadn't gotten to yet. Still, I love that without any idea how to use the app, I was able to get an assembly line of folders that save me TONS of time.

I've set up a folder than unarchives. I have to manually rename/renumber and delete pages, which is alright. It's tedious, but there's a zen to it. It's kind of necessary because it's not always the last page (or JUST the last page), but the last 2, the first 1 or 2, sometimes there's ads I don't want, previews. Sometimes the pages are out of order. It's a necessary evil.

Once I've done a batch, I move to another folder that re-archives, renames to .cbr and moves to a 3rd folder where they can be moved out.

I will read the match and token sections, but is there a simple way to set up that 3rd folder so that when the files are moved/copied to another folder (on another drive), it'll move the original to the trash?

Thanks again. Once I get over the mountain backlog, the maintenance will be simple. Hazel's been a pretty amazing assistant so far.

5x5
5x5
 
Posts: 11
Joined: Fri Jul 13, 2012 10:03 pm

Re: Comic Book Organization Help Requested Tue Jul 17, 2012 3:31 pm • by Mr_Noodle
Well, when moving across drives, a move is just a copy plus deleting the original so just use a move operation whenever you want to do a copy + throw away.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Comic Book Organization Help Requested Thu May 02, 2013 5:34 pm • by Glgamesh
Hello Mr_Noodle,

I wanted to re-open this thread as the poster states exactly what I want to do except I would like to accomplish steps 1 and 2 with Hazel.

Right now, my Hazel rules will select a CBR file, change the extension to RAR, unarchive, archive and then change the extension to CBZ. This works pretty well except for some odd instances where the name of the archived folder was oddly different from the final name of the RAR archive.

Anyway, I noticed that the pages I want to delete generally begin with "z". What I would like to do is, before re-archiving, is to search the folder and remove any jpg file beginning with "z". It doesn't look like I can do it without a script or Automator action, but I really have no idea how. Would you be able to offer suggestions? Anything would be great.

Also, I did create an Automator workflow which is stored in ~/Library/Workflows. (I don't believe it works at all.) But, the odd thing is, I can't find it when asking Hazel to open an Automator action. The ~/Library files hidden by default in Lion and Mountain Lion aren't showing up though I have made them visible through Terminal and can see them in Finder. Not sure why this is happening as I would think that being able to see the hidden files in Finder would allow Hazel to see them as well, but no hidden folders or files when looking for the action.

Anyway, great product. I just got turned on to it and have it working for re-encoding movie and tv files already.
Glgamesh
 
Posts: 7
Joined: Thu May 02, 2013 5:19 pm

Re: Comic Book Organization Help Requested Thu May 02, 2013 8:43 pm • by Glgamesh
Well, I have been working on it and don't understand why the following won't work.

I use the Go Into Subfolders rule for the folder in which I send all my comic files.
Then I created a rule which:
1. Renames the cbr to rar
2. unarchives the far
3. Then I run a shell script rm z*.jpg

The shell script works on the opened far directory using Terminal. I don't get a notification that it failed when running it in Hazel, but the file remains. When there is not a file matching z*.jpg, then I get a script error notification.

I placed a Run rules on folder contents action before the shell script and it still did not work.

Any ideas are appreciated.
Glgamesh
 
Posts: 7
Joined: Thu May 02, 2013 5:19 pm

Re: Comic Book Organization Help Requested Fri May 03, 2013 12:14 pm • by Mr_Noodle
Is that the full script? It seems like you are making assumptions about which directory you are in. You should specify the full path of the files you are deleting otherwise you may end up deleting files in a random directory.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Comic Book Organization Help Requested Fri May 03, 2013 12:28 pm • by 5x5
For what it's worth, I ended up having to do half of the editing manually, half with Hazel. It really didn't take all that long. And now going forward is really easy.

I used Hazel to unarchive; I manually edited the folder names; manually removed files I didn't want (90% were the final .jpg(s) in the folder); and used Hazel to re-archive, rename as .cbr and move to a holding folder.

Lemon squeezy. Less dynamic than using scripts and know-how, but it got the job done.

And that's with me having upgraded from the 16gb iPad to a 64gb. Probably saved me gigs of space on the new one, though, so I'll keep doing it.

Good luck with your solutions. Hope you find a helpful answer.

5x5
5x5
 
Posts: 11
Joined: Fri Jul 13, 2012 10:03 pm

Re: Comic Book Organization Help Requested Mon May 06, 2013 8:31 pm • by Glgamesh
Mr_Noodle wrote:Is that the full script? It seems like you are making assumptions about which directory you are in. You should specify the full path of the files you are deleting otherwise you may end up deleting files in a random directory.


I don't have any problem with the files. The only jpg files will be in the newly opened rar directory. All other files will be cbr, rar, zip or cbz. Also, the only files I want removed from that directory are jpg starting with z. If that changes I can update what needs to be removed.

So, when I run the rule, which directory is being looked at? The Hazel-watched folder or the newly unarchived directory? If Hazel isn't looking at the unarchived directory, how can I make this happen?
Glgamesh
 
Posts: 7
Joined: Thu May 02, 2013 5:19 pm

Re: Comic Book Organization Help Requested Mon May 06, 2013 8:38 pm • by Glgamesh
@5x5

What I am looking to do after I am able to remove the scanner image is to use tokens to rename the directory before zipping it up.

I am using Mylar to get comics. It automatically renames the cbr files to [Series] [Year] [Issue]. I will take that name to rename the directory and then zip it and change the extension to cbz. That should save a lot of time.

I see what you are doing but I have been doing that or something similar and man, it gets tedious. If I can't get the z*.jpg files deleted, I may have to run 2 rules where the first one stops after unarchiving, then I can search on all z*.jpg files in Finder, delete them and re-archive. That would still be less time intensive than looking at each one.
Glgamesh
 
Posts: 7
Joined: Thu May 02, 2013 5:19 pm

Re: Comic Book Organization Help Requested Wed May 08, 2013 2:44 pm • by Glgamesh
Well, I got it running.

I found it easiest to break it up into 6 rules.

1. Go into subfolders - subfolder depth less than 1
2. Unarchive any .rar
3. Delete Scanner Page 1 - this was the tough one as it initially conflicted with rule 1 until I set the depth. Of course, once the depth stopped in rule 1 I now had to make Hazel look at the files in folders that were of depth 2. So I broke up the Delete Scanner page rule into 2 parts. The first one just matched the sub 2 folder by looking at its files. If it had a jpg in it, then I ran the rules on folder contents.

4. Delete Scanner Page 2 - This just looked for any jpg starting with "z" and moved it to a folder so I could check it. It worked fine.

5. Archive - Now as the first rule stopped at depth 2, this archived the right folders.

6. Rename zip to cbz.

I have been running this for a day now and it has done its job. I can see there will be an issue with jpgs I don't want that don't start with "z". I haven't seen any yet that don't start with "z", but I am sure they are there.

Also, as I pull these comics into Comic Rack, I like having the file naming convention the same. The problem with this is that sometimes the rar file unzip to a scanner named folder. I expect I can get around this with a token that sets the value to the initial rar file name and then renames the folder, but I haven't seen much on how to create/use tokens.
Glgamesh
 
Posts: 7
Joined: Thu May 02, 2013 5:19 pm


Return to Support

cron