Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6884273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:29:13+00:00 2026-05-27T05:29:13+00:00

In brief, I need to do something like this: I have a folder with

  • 0

In brief, I need to do something like this:

  1. I have a folder with a lot of files and want to process all files with extension .epub.
  2. All files already follow a naming scheme: Lastname, Firstname – Title.epub or Lastname, Firstname – Series x – Title.epub and I need a parser for Lastname, Firstname, Series (if existing) and Title.
  3. I have a command-line tool that sets metadata: ebook-meta filename -a “Firstname Lastname” -t Title

There are many snipplets for 1.), however I am in need for input for 2.) and appreciate any help/pointers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:29:14+00:00Added an answer on May 27, 2026 at 5:29 am

    You can start with the following and change it to meet your needs. It compiles, although untested.

    set p to POSIX file "/Users/kaass/Desktop/test/"
    tell application "Finder" to set filelist to name of every file of folder p
    
    repeat with filename in filelist
        set text item delimiters to ""
        if text -5 thru -1 of filename is equal to ".epub" then
            set temp to items 1 thru -6 of filename as text
    
            set text item delimiters to " - "
            set myWord to text items 1 thru -1 of temp
            set title to myWord's last item as text
    
            if myWord's length is equal to 3 then set series to myWord's second item as text
    
            set myWord to item 1 of myWord as text
            if myWord contains "," then
                set text item delimiters to ", "
            else
                set text item delimiters to " "
            end if
            set author to (text item 2 of myWord) & space & (text item 1 of myWord)
            set path_and_filename to POSIX path of file p & filename
            do shell script "echo Processing file " & quoted form of path_and_filename & ": " & author & " +++ " & title
            do shell script "/Applications/calibre.app/Contents/MacOS/ebook-meta " & quoted form of path_and_filename & " -a " & quoted form of author & " -t " & quoted form of title
        end if
    end repeat
    

    Just comment if you need something to be changed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope you can help! In brief, what I need is something like a
I know I need to use the . something like .live to get this
i have function which is something like this function multiple_delete($entity1,$entity2,$entity2) { $query = SELECT
I want brief knowledge about Data Template for Customizing a control(like Combo Box,List Box
This is an example of what I'd like to do: Do all the display
In brief: Is it ever excusable to have assembly names and class names stored
I'll keep this brief. I am trying to keep a map between strings and
From a brief look using Reflector, it looks like String.Substring() allocates memory for each
I've this brief snippet: String target = baseFolder.toString() + entryName; target = target.substring(0, target.length()
My prob in brief: I have two tables namely category and product. table: category

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.