Welcome, Guest
Python Scripts for ComicRack

TOPIC: Newbie rough guide to a simple script

Newbie rough guide to a simple script 8 years 8 months ago #3196

  • JoradZero
  • JoradZero's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
I thought any other newbie ComicRack script writers out there might appreciate my experience. My steps below assume that you know how to program in some language (python not required). This is a rough guide for a simple script, not an in depth tutorial.

I've had ComicRack for about 2 weeks. And I LOVE IT. I disagree that it is like iTunes, it is BETTER than iTunes. Esp. the remote library features.

So I jumped right in and wrote a script to:
# Changes ShadowSeries:
# "blah for Dummies" or "blah for Dummies #aa Edition"
# to
# Series = "Dummies"
# Title = "blah" or "blah #aa Edition"

I don't know python (but know about 7 other languages).
1. Started by making a copy of CommitProposed.py (don't use sample.py is my recommendation).
2. Stripped all code but the "for book in books:" line, changed the @Name
3. Found "MessageBox.Show" in Sample.py, added in the required imports:
import clr
clr.AddReferenceByPartialName("System.Windows.Forms" )
from System.Windows.Forms import *
4. MessageBox to display see the book.ShadowSeries values.
5. First script test, no "Fix Dummies" in menu, but two "Commit Proposed" in menu. Exited and reload showed "Fix Dummies" this time. I assume it is a minor CR bug.
6. String manipulation. Not knowing python, I go to:
en.wikipedia.org/wiki/Comparison_of_programming_languages
which has on right links to pages which show how to do functions in one language in another language.
7. At some point in I ran into a "no matching indent" error". What is this, Fortran? So I matched the indents.
8. Rest is just the string manipulation. I am well aware that there are much better python string methods to do what I did, but my goal was to get a script working, finesse comes later.

Script is attached, have fun.
The administrator has disabled public write access.

Re:Newbie rough guide to a simple script-attached 8 years 8 months ago #3197

  • JoradZero
  • JoradZero's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
Tried to upload script as image. Told ya I was a newbie :)

Attached now (I hope)

File Attachment:

File Name: Fix_Dummies.zip
File Size:1 KB
Last Edit: 8 years 8 months ago by JoradZero.
The administrator has disabled public write access.
Time to create page: 0.160 seconds

Who's Online

We have 244 guests and one member online