• 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
how to suppress or ignore errors?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to suppress or ignore errors?


  • Subject: how to suppress or ignore errors?
  • From: Mari Masuda <email@hidden>
  • Date: Fri, 9 Oct 2009 15:11:46 -0700

Hi,

As you may recall from my question the other day, I am working on a script to convert Adobe InDesign files to HTML.  Using AppleScript, I first open the InDesign files and export them to InDesign tagged text files.  Then I have a PHP script that turns the tagged text files into HTML that is "good enough" to be understood by someone who knows HTML (but it would never validate).  Finally, I run the "good enough" HTML files through tidy to get valid XHTML.  The problem I am having is that since the files I am inputting into tidy are not completely correct XHTML, tidy exits with an error code of 1 and a message that shows the errors/warnings.  This makes it so only the first "good enough" HTML file gets processed and then my AppleScript exits due to the error handler.  I was wondering if there is a way to tell my AppleScript to ignore the errors generated by tidy and just continue processing.  I have tried enabling the "-q" (quiet) option of tidy but that doesn't suppress the errors, it only makes the error message shorter.  Below are the relevant parts of my AppleScript.  Thank you, and sorry for all of these newbie questions!

Mari

try
-- irrelevant stuff not shown... all of the stuff above here seems to be working fine

repeat with currentINDDfile in listOfINDDfilesAfterSomeCouldHaveBeenDeleted
set quotedPOSIXpathToCurrentINDDfile to (quoted form of POSIX path of currentINDDfile)
do shell script ("php -f /Applications/apache/htdocs/INDDtoHTML/index.php " & quotedPOSIXpathToCurrentINDDfile)
do shell script ("tidy -m -i -wrap 0 -asxhtml -utf8 -q " & quotedPOSIXpathToCurrentINDDfile)
end repeat



tell application "Finder"
activate
display alert "INDD to HTML processing complete!"
end tell



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



end try
 _______________________________________________
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: how to suppress or ignore errors?
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: not all dropped items make it
  • Next by Date: Re: how to suppress or ignore errors?
  • Previous by thread: Re: Open folders in new window
  • Next by thread: Re: how to suppress or ignore errors?
  • Index(es):
    • Date
    • Thread