• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
script works when reading from DVD but not when reading from hard disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

script works when reading from DVD but not when reading from hard disk


  • Subject: script works when reading from DVD but not when reading from hard disk
  • From: Mari Masuda <email@hidden>
  • Date: Tue, 6 Oct 2009 14:16:36 -0700

Hi,

I've run into a problem with a script I'm working on where the script works fine when reading from a DVD but fails with an error when reading from the hard drive.

The purpose of the entire script is to convert Adobe InDesign files (.indd) into InDesign tagged text files, which I then process via PHP for conversion into HTML.  (Yes, I realize InDesign will export to HTML but the result is not correct as it loses formatting info such as italicized words.  I know next to nothing about InDesign... my job is to take the InDesign files, which are for a printed journal publication, and turn them into HTML and post them on my work's website.)

The portion of the script I'm having trouble with is the "repeat with currentINDDfile in listOfINDDfiles" block:

try
set parentINDDfolder to (choose folder with prompt "Select the folder that contains the InDesign files:" default location (alias "Macintosh HD:"))
set outputFolder to (choose folder with prompt "Select the folder to write the HTML files to:" default location (alias "Macintosh HD:filesWrittenFromPHP:"))


set listOfINDDfiles to {}
getAllINDDfiles(parentINDDfolder, listOfINDDfiles) --lists are passed by reference


--log "indd"
--log listOfINDDfiles


repeat with currentINDDfile in listOfINDDfiles
tell application "Finder"
log "MARI"
set aliasToNewFolder to (make new folder at outputFolder with properties {name:(name of (container of currentINDDfile) as text)}) as alias
log "MARI2"
set aliasToLinksFolder to (make new folder at aliasToNewFolder with properties {name:"Links"}) as alias
log "MARI3"
end tell
convertINDDtoTaggedText(currentINDDfile, aliasToNewFolder)
copyLinksFolders(currentINDDfile, aliasToLinksFolder)
end repeat


-- do more stuff here... (these parts seem to work fine so I did not include them in order to save space and highlight the problem area)



on error errorMessage number errorNumber
tell application "Finder"
activate
display alert "An error has occurred (" & errorNumber & ").  " & errorMessage
end tell


end try


The error I get (copied from AppleScript log) when the files I am converting are located on my hard drive is:
(*MARI*)
end tell
tell application "Finder"
get name of container of alias "mari:Desktop:maritest:indd:hoov-09-04-01 Folder:hoov-09-04-01.indd"
activate
display alert "An error has occurred (-1700).  Can't make name of «class ctnr» of item 1 of {alias \"mari:Desktop:maritest:indd:hoov-09-04-01 Folder:hoov-09-04-01.indd\"} into type string."
{button returned:"OK"}
end tell


However, when the files I am converting are on a DVD everything works and this is the log output from MARI to MARI3:
(*MARI*)
end tell
tell application "Finder"
get name of container of alias "xxx publication 2009 No. 4:indd:hoov-09-04-01 Folder:hoov-09-04-01.indd"
"hoov-09-04-01 Folder"
make new folder at alias "Macintosh HD:filesWrittenFromPHP:blah:" with properties {name:"hoov-09-04-01 Folder"}
folder "hoov-09-04-01 Folder" of folder "blah" of folder "filesWrittenFromPHP" of startup disk
get folder "hoov-09-04-01 Folder" of folder "blah" of folder "filesWrittenFromPHP" of startup disk
alias "Macintosh HD:filesWrittenFromPHP:blah:hoov-09-04-01 Folder:"
(*MARI2*)
make new folder at alias "Macintosh HD:filesWrittenFromPHP:blah:hoov-09-04-01 Folder:" with properties {name:"Links"}
folder "Links" of folder "hoov-09-04-01 Folder" of folder "blah" of folder "filesWrittenFromPHP" of startup disk
get folder "Links" of folder "hoov-09-04-01 Folder" of folder "blah" of folder "filesWrittenFromPHP" of startup disk
alias "Macintosh HD:filesWrittenFromPHP:blah:hoov-09-04-01 Folder:Links:"
(*MARI3*)
end tell


Any clues would be greatly appreciated.  Thanks!

Mari
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: script works when reading from DVD but not when reading from hard disk
      • From: Shane Stanley <email@hidden>
    • Re: script works when reading from DVD but not when reading from hard disk
      • From: "Stockly, Ed" <email@hidden>
    • Re: script works when reading from DVD but not when reading from hard disk
      • From: David Wolfe <email@hidden>
  • Prev by Date: Re: text to dark pdf
  • Next by Date: Re: script works when reading from DVD but not when reading from hard disk
  • Previous by thread: Re: How to fix modified links in InDesign CS3
  • Next by thread: Re: script works when reading from DVD but not when reading from hard disk
  • Index(es):
    • Date
    • Thread