save story in Quark6 seems flaky
save story in Quark6 seems flaky
- Subject: save story in Quark6 seems flaky
- From: Scott Lawton <email@hidden>
- Date: Wed, 9 Mar 2005 15:25:52 -0500
Any idea why save story might fail sometimes? Is there a better way to get the same text that's exported using File > Save Text? (As noted in the comments, "get text" gets something different.)
In the following, I know that outputFolder exists; I use it earlier in the script.
The error msg: "QuarkXPress got an error: Disk some object wasn't found." The problem happens on someone else's machine (OS X; not sure which version). Any suggestions for additional debugging code I could add to pinpoint what's going on?
tell application "QuarkXPress"
set target_file to (outputFolder & my getBaseName(name of document 1) & ".txt")
-- snip figuring out which story to save
-- it sets longestID
-- saving the story directly appears to mimic the
-- File > Save Text menu item; that's what we want
-- in contrast, "get text" includes control chars with
-- uncertain mapping (convert to whitespace vs. delete)
-- note that target_file must be a string not alias
save story longestID in target_file
end tell
end tell
on getBaseName(inString)
-- drop 3 or 4 char extension
if (character -5 of inString is equal to ".") then
return text from character 1 to -6 of inString
else if (character -4 of inString is equal to ".") then
return text from character 1 to -5 of inString
else
return inString
end if
end getBaseName
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden