Illustrator & rtf
Illustrator & rtf
- Subject: Illustrator & rtf
- From: Peter Matthias Noordzij <email@hidden>
- Date: Tue, 09 Apr 2002 23:15:51 +0200
Sorry to re-post this, but I accidentally pasted the "tell Illustrator"
block twice. Please discard the message "Illustrator & rtf" I sent
earlier today. Sorry for the inconvenience. Matthias
02/04/04 01:11, I posted to this list:
>
I'm trying to import a formatted text file (more explicitly an .rtf) into an
>
Illustrator document via AppleScript. Though you can achieve this (through
>
the menu) with the place command, the scriptable placed item only supports
>
eps or pdf files and not rtf. Any ideas if this can be achieved by
AppleScript?
But alas, nobody responded... :-(
Anyway, I tried several other options and copy & paste seems to work:
== begin script
tell application "Finder"
activate
set theAlias to choose file with prompt "Select an .rtf file" of type
{"RTF "}
set theName to the name of the result
end tell
tell application "Adobe Illustrator. 9.0.2"
activate
open theAlias
tell document theName
activate
set selection to the text of text art item 1 of layer 1
copy
close saving no
end tell
make new document with properties {color space:CMYK}
tell document 1
set theBox to make new text art item in layer 1 with properties
{kind:area text, contents:"pastebox"}
set the properties of the text of theBox to {filled:true,
stroked:false} --size:10, fill color:black
set the entire path of the last path item in theBox to {{0, 800},
{0, 0}, {600, 0}, {600, 800}}
set the selection to the text of theBox
paste
end tell
set the selection to ""
end tell
== end script
Though this script runs fine when addressing Illustrator 9.0.2, it
generates a curious error when addressing Illustrator 10 (running
under the same OS 9.2.2):
Acrobat PDF File Format is having difficulties. Another file
already exists under the same name.
Does anybody have a clue what this messages means, and more
specifically, if there is a workaround to avoid the error. Thanks.
Matthias Noordzij
* * *
Peter Matthias Noordzij Waaldijk 77 5327 AB Hurwenen
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.