Strange "on open" error
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