Re: Illustrator CS 3 'open' command sometimes throws error 8700
Re: Illustrator CS 3 'open' command sometimes throws error 8700
- Subject: Re: Illustrator CS 3 'open' command sometimes throws error 8700
- From: Hamish Sanderson <email@hidden>
- Date: Fri, 25 Sep 2009 12:58:27 +0100
Simon Topliss wrote:
Writing an Illustrator CS 3 script which opens an .ai file off a
previously mounted AFP share to do some processing on it. Bog-
standard stuff:
tell app "Adobe Illustrator"
set user interaction level to never interact
open alias "path:to:file.ai" without dialogs
Is the alias above a 'file path as string' stored in a variable?
It's an AppleScript alias stored in a variable.
set the_path to "path:to:file.ai"
set file_alias to alias the_path
tell app "Adobe Illustrator"
...
open file_alias without dialogs
...
end tell
Most times this works without problem, but sometimes the file
doesn't appear in AI and it raises an error 8700 ('the operation was
cancelled') instead. If I re-run the same command myself, it works
the second time around.
The 'the operation was cancelled' error is probably the result of the
"set user interaction level to never interact" and "open ? without
dialogs" commands. This may be hiding the actual error (probably a
'file not found' error). Do you get a different error without those
options?
The 'never interact' and 'without dialogs' code is to prevent AI from
throwing up dialog boxes when opening a file, as the script needs to
run unattended.
Most .ai files have broken image links after being moved to different
locations (this is one of the things the script fixes), so 'relink
image' dialogs will pop up without it. These dialogs seem to be
suppressed okay (the .ai file opens with the linked images missing as
expected) - unless this part of Illustrator is subject to occasional
glitches, in which case that might be what's causing the intermittent
'open' command error.
FWIW, I've found AI's dialog suppression support to be rather patchy
overall, with some dialogs insisting on displaying regardless of what
you do. For example, missing fonts are also an issue with some of
these .ai files; something I'd like the script to make a note of and
then proceed as normal. However, I've found AI pops up 'missing font'
dialogs even with the 'never interact' and 'without dialogs' options
are set. Whether this is Illustrator or Suitcase's fault I don't know;
for now I've got some GUI Scripting code that types 'Return' if the
'open' command times out, but that's not exactly an ideal solution.
Anyone have any ideas what might be causing this? AI's error message
is not exactly helpful. (AI 13.0.2, OS X 10.5.7 Intel)
Any reason for still being on 10.5.7? I know Apple did quite a bit
with AFP bug fixes on 10.5.8 (particularly with 10.5.8 server).
We ran into some nasty problems when upgrading those particular boxes
from 10.5.6 to 10.5.7, so haven't been in a hurry to mess with them
again. However, I'll try updating the one that's currently throwing
up these errors to see if that makes a difference.
p.s. Don't suppose anyone knows if there's a publicly available list
of all AI error codes for reference?
Not that I've ever found.
Unfortunate. AI goes to a lot of trouble to use custom codes to
distinguish different types of errors. Not publicly documenting what
those codes mean rather defeats the purpose though.
Thanks,
Hamish
--
Hamish Sanderson
Production Workflow Developer
Sun Branding Solutions Ltd
Tel: +44(0)1274 200 700
www.s-brandingsolutions.com
_______________________________________________
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