• 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: Exporting JPEGs from Illustrator CS6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exporting JPEGs from Illustrator CS6


  • Subject: Re: Exporting JPEGs from Illustrator CS6
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 28 Mar 2014 10:22:08 +1100

On 28 Mar 2014, at 4:56 am, 2551 <email@hidden> wrote:

set thePath to (characters 1 thru -4 of thePath) as text


We'll bury this construction one day...

Please don't do this. It not only involves unnecessary work -- you're making a list and then coercing it to text -- but the result also relies on the value of text item delimiters. If it's anything other than the default, you end up with a mess.

set thePath to text 1 thru -4 of thePath

is the way to extract a substring. It's even less typing.

But in this case, although the OP said Illustrator documents, they may not all be .ai, so it would probably be safer to use something like:

set saveTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"."}
set thePath to text 1 thru text item -2 of thePath
set AppleScript's text item delimiters to saveTID

More typing, but it doesn't hard-code the length of the extension.

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

References: 
 >Exporting JPEGs from Illustrator CS6 (From: Robert Stott <email@hidden>)
 >Re: Exporting JPEGs from Illustrator CS6 (From: "koenig.yvan" <email@hidden>)

  • Prev by Date: Re: Root User
  • Next by Date: do shell script
  • Previous by thread: Re: Exporting JPEGs from Illustrator CS6
  • Next by thread: do shell script
  • Index(es):
    • Date
    • Thread