• 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
Strange "on open" error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange "on open" error


  • Subject: Strange "on open" error
  • From: Ken Tozier <email@hidden>
  • Date: Sun, 11 Jan 2009 00:05:14 -0500

Hi

I wrote a script to convert Quark style sheets to XML for use by a Cocoa application and am getting the correct behavior if run it in script editor manually but if it is opened by a droplet script (either targeting the finder->open or Quark's open) I'm getting raw data in record fields rather than the coerced types I get when the file was opened manually. Anyone know how I can get around this?

Here's a simple case: Say I have a Quark document "AA_template.qxp" When I hard code the alias in the script, it works perfectly

set draggedItems to {alias "Macintosh HD:Users:kentozier:Desktop:AA_template.qxp"}

repeat with anItem in draggedItems
tell application "Finder"
set fileName to name of anItem
if ((fileName does not start with ".") and (fileName ends with ".qxp")) then
set fileAlias to anItem as alias
set styleSheetPath to my CreateStyleSheetFile(fileName, fileAlias, styleSheetsFolder)
end if
end tell
end repeat


If, however I make it a droplet with an on open handler,

on open draggedItems
repeat with anItem in draggedItems
tell application "Finder"
set fileName to name of anItem
if ((fileName does not start with ".") and (fileName ends with ".qxp")) then
set fileAlias to anItem as alias
set styleSheetPath to my CreateStyleSheetFile(fileName, fileAlias, styleSheetsFolder)
end if
end tell
end repeat
end open


I'm getting the error: Can't make «data FXHM00000C00» into a type string

Sounds like the Quark dictionary isn't loading correctly when run from a droplet. Is there a way to force a dictionary load or some other workaround to get this working?

System info: Intel Core-Duo, OS 10.5.6, Quark 7.31

Thanks for any help



_______________________________________________
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: Strange "on open" error
      • From: Shane Stanley <email@hidden>
    • Re: Strange "on open" error [Solved]
      • From: Ken Tozier <email@hidden>
  • Prev by Date: Re: Script to remove AUGD from Subject
  • Next by Date: Re: Strange "on open" error [Solved]
  • Previous by thread: Re: Script to remove AUGD from Subject
  • Next by thread: Re: Strange "on open" error [Solved]
  • Index(es):
    • Date
    • Thread