• 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
Re: Open Files for Illustrator
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open Files for Illustrator


  • Subject: Re: Open Files for Illustrator
  • From: simeli <email@hidden>
  • Date: Wed, 27 Oct 2004 15:36:35 +0200

Hi Ben

I am just writing a script, that takes all files from a source folder,
opens them in illustrator, changes all text to outlines and saves them to
a destination folder as an eps file.

maybe my code helps with your problem. however it does throw an error
when there's only one document in the source folder. maybe someone has a
solution...

--(c) Simon Grasser 2004
--wandelt allen Text in Illustrator Grafikformaten in Pfade um
--und speichert die neue Grafik als eps ab

--Quellordner auswählen
set sourceFolder to choose folder with prompt "Source folder?"

--Aliasliste aller files im Quellordner erstellen
tell application "Finder" to set fileList to every file of folder
sourceFolder as alias list

--Zielordner auswählen und Zielpfad als String speichern
set destinationFolder to choose folder with prompt "Destination folder?"
set destinationPath to destinationFolder as string

--iteriere über die Liste der files im Quellordner
repeat with aFile in fileList
	tell application "Finder" to set fileName to name of aFile
	set newFilePath to destinationPath & fileName & ".EPS"


	--Adobe Illustrator auswählen
	tell application "Illustrator CS"
		--activate

		--erstes File aus Liste auswählen
		open aFile

		--iteriere ueber alle Obkjekte auf der Seite
		repeat with i from 1 to count of page items of current document

			--setze Auswahl auf Seitenobjekt i auf Layer 1 (kann auch weggelassen
werden)
			set selection to page item i of current document --of layer 1 of
current document

			--falls Auswahlobjekt der Klasse text frame angehört
			if class of selection is text frame then --targetItem is text frame then

				--in Pfade umwandeln
				convert to paths selection --targetItem
			end if
			--end repeat

			--Auswahl aufheben
			set selection to false
		end repeat
		set i to 1
		set selection to false

		--Dokument unter neuem namen speichern in Zielordner
		save current document in file newFilePath as eps with options {class:
EPS save options, compatibility:Illustrator 9, preview:color Macintosh,
embed linked files:true, include document thumbnails:true, embed all
fonts:true, CMYK PostScript:true, PostScript:level 2}

		--original Dokument schliessen ohne zu speichern
		close current document saving no

		--Ende Illu Anweisungen
	end tell

end repeat

>Hey All,
>I'm not having any luck automating a script on all the files in a
>folder.
>I've tried:
>
>set the topLevelFolder to (choose folder)
>
>tell application "Illustrator CS"
>	open file 1 of topLevelFolder
>end tell
>-- Illustrator CS got an error: File some object wasn't found.
>
>
>set the topLevelFolder to (choose folder)
>
>tell application "Illustrator CS"
>	open document 1 of topLevelFolder
>end tell
>-- Illustrator CS got an error: Can't make some data into the expected
>type.
>
>Illustrator's dictionary says:
>open: Open the specified document file(s)
>	open  anything  -- the file(s) to be opened
>
>set the topLevelFolder to (choose folder)
>
>tell application "Finder"
>	set foo to files of the topLevelFolder
>-- Finder got an error: Can't get every file of alias
>"macg4:Desktop:Lips script test:".
>If I add the "as list" to the end of that line, the script moves on.
>However, I can't then get it to open anything.
>
>Ben.
>Hey All,
>I'm not having any luck automating a script on all the files in a folder.
>I've tried:
>
>set the topLevelFolder to (choose folder)
>
>tell application "Illustrator CS"
>	open file 1 of topLevelFolder
>end tell
>-- Illustrator CS got an error: File some object wasn't found.
>
>
>set the topLevelFolder to (choose folder)
>
>tell application "Illustrator CS"
>	open document 1 of topLevelFolder
>end tell
>-- Illustrator CS got an error: Can't make some data into the expected type.
>
>Illustrator's dictionary says:
>open: Open the specified document file(s)
>	open  anything  -- the file(s) to be opened
>
>set the topLevelFolder to (choose folder)
>
>tell application "Finder"
>	set foo to files of the topLevelFolder
>-- Finder got an error: Can't get every file of alias "macg4:Desktop:Lips
>script test:".
>If I add the "as list" to the end of that line, the script moves on.
>However, I can't then get it to open anything.
>
>Ben.
> _______________________________________________
>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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Open Files for Illustrator
      • From: Ben Broad <email@hidden>
    • Re: Open Files for Illustrator
      • From: wayne melrose <email@hidden>
References: 
 >Open Files for Illustrator (From: Ben Broad <email@hidden>)

  • Prev by Date: Re: open a url in camino
  • Next by Date: Re: Open Files for Illustrator
  • Previous by thread: Open Files for Illustrator
  • Next by thread: Re: Open Files for Illustrator
  • Index(es):
    • Date
    • Thread