Re: Exporting JPEGs from Illustrator CS6
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.
|
_______________________________________________
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