• 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: Steven Valenti <email@hidden>
  • Date: Wed, 27 Oct 2004 10:08:11 -0400

This will open every file in a chosen folder and if can't will display
dialog that it could not be opened.



set the topLevelFolder to (choose folder) as string


tell application "Finder"

        set AllFiles to name of every file of folder topLevelFolder as list

end tell


tell application "Illustrator CS"

activate

repeat with i in AllFiles

set OpenThisDoc to ((topLevelFolder as string) & i) as alias

try

open OpenThisDoc

on error

display dialog "File " & i & " could not be opened." buttons "OK" default
button 1

end try

end repeat

end tell




On Wednesday, October 27, 2004, at 06:18 AM, Ben Broad wrote:


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.


<ATT32915.txt>


 _______________________________________________
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>
  • Prev by Date: Re: Open Files for Illustrator
  • Next by Date: Re: Dice
  • Previous by thread: Re: Open Files for Illustrator
  • Next by thread: Re: Open Files for Illustrator
  • Index(es):
    • Date
    • Thread