View Single Post
Old 02-05-2011, 08:15 PM   #32
ronmartinez
Junior Member
ronmartinez began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2011
Location: San Francisco
Device: iPad
Quote:
Originally Posted by MichaelGray View Post
Hi there
Hope somebody can help with this - I've been using ePub zip for a while and it's been a fantastic saviour, but suddenly it doesn't seem to work any more. When I try to zip my folder into epub I get an error message: "Can't make <<class ctnr>> of item 1 {alias "Macintosh HD:Users:Mini25esktop:nameofmyfolder:"} into type text." I can OK this or press an "Edit" button, which opens the Apple Script Editor (beyond me!)
Not sure what changed on my system or in my epub - it just seems to have changed from one day to the next. Any ideas?
Thanks very much
Michael
Hi! Not sure if you've gotten this sorted out. I had the same experience with this wonderfully useful script when I tried to use it on a different machine (Mac Pro, fine, Macbook, exact same error). Odd.

I was able to work around it with a hack to the Applescript. It's not a fix, just a way to keep working. You're going to delete the troublesome code and hardwire the result it's attempting to produce - a path (i.e., location on your hard drive) to place the finished ePub file.

The steps:

- Open the script in the Applescript Editor
- Run the script from the Editor, using the green run button, and select your ePub folder
- It should fail with error message once you have selected the folder
- Note at the bottom of the Editor there is an Event Log. You should see something like this:

error "Can’t make «class ctnr» of alias \"home:Users:ronmartinez:a_yo_iBookC:\" into type text." number -1700 from «class ctnr» of alias "home:Users:ronmartinez:a_yo_iBookC:" to text

(The error apparently has something to do with the attempt to re-type the alias so it can be used in a variable. Needs some investigation and puzzling out, but this is happening in the 5th line of the script:

set ePubParent to (container of ePubFolder) as text

The workaround: hardwire the ePubParent variable. This will be the location your newly created ePub will be placed in. To do the hardwiring, you'll put a properly formatted path into the variable. I just used the same folder the ePub is in, but you can use another.)

- Note the correct form of the path in the second line of your error message in the Event Log. In my example:

"home:Users:ronmartinez:a_yo_iBookC:"

- Copy that string of text, including the quotes.
- Replace the troublesome line 5 with a line of text that says the following:

set ePubParent to "home:Users:ronmartinez:a_yo_iBookC:"

Of course, using your own path, and not my example path!

- Save As the script with a new name.
- Run the script
- It should work, and deposit the finished ePub at the destination indicated by the path. Note that you can use any destination folder on your hard drive volume, as long as the proper format is used.

Hopefully this helps. Back up your work before you do anything, natch. But should be pretty innocuous, and hopefully provides the OP with some clues as to the bug. (And thank you for this script, again!).

- Ron
ronmartinez is offline   Reply With Quote