Re: AS for InDesign - find artwork set to overprint
Re: AS for InDesign - find artwork set to overprint
- Subject: Re: AS for InDesign - find artwork set to overprint
- From: "email@hidden" <email@hidden>
- Date: Tue, 17 Nov 2009 08:15:43 -0800
Hey Rosemary,
Glad you could get that working. I can now see exactly what your were wanting.
> Also can you tell me what the line -- set AppleScript's text item delimiters to {":"} -- means? I followed pretty much what was being done until there.
On a mac file paths are separated by colons (:) when coerced to text.
So a file path looks like this: "Drive:folder:file"
The text item delimiters allow you to set a character to use to separate text, so text items of a file path using the : as a delimiter becomes an applescript list that looks like this:
{"drive", "folder","file"}
The last item in the list is the file name.
You could also use the finder or system events to get the file name (tell application finder to set linkName to the name of file linkPath)
> Since I have so many files to do this to, is it possible to batch it somehow? Or add to the script to do multiple documents?
To handle batch processing you have several options.
I would start by using an open handler and saving your script as an application.
On open docList
repeat with thisDoc in docList
--do your stuff here
end repeat
end open
Your script would work on files dropped on its icon.
I'd also suggest putting the meat of your script into a separate handler
On FixOverPrint (myDocument)
tell application "Adobe InDesign CS3" to open myDocument
--your stuff here
tell application "Adobe InDesign CS3" to close active document saving yes --untested
end fixDocument
You could then call it from a run handler that allows the user to select multiple files or all ID files from a folder(s).
This list is a good source for good advice, but you may be ready for one of the really good appleScript books that are available.
HTH,
ES
>
> Thank you so much for responding. I ended up modifying what you
> started slightly and it works!! :)
>
> set listOfNames to {"1d5pt underline bleed bitmap HI-X.tif", "1d5pt
> underln bld btmp HI-X.tif", "2pt underline bitmap HI-X.tif"}
> tell application "Adobe InDesign CS3"
> tell active document
> set docGraphics to all graphics
> repeat with thisGraphic in docGraphics
> set graphicLink to item link of thisGraphic
> set linkPath to the file path of item link of thisGraphic
> set AppleScript's text item delimiters to {":"}
> set linkName to the last text item of linkPath
>
> if linkName is in listOfNames then
> set overprint fill of thisGraphic to true
> end if
> end repeat
> end tell
> end tell
>
> I've posted this question on the ID List also, but maybe you have some
> suggestions:
>
> Since I have so many files to do this to, is it possible to batch it
> somehow? Or add to the script to do multiple documents? Thanks for
> your help. I really appreciate the guidance.
>
> Also can you tell me what the line -- set AppleScript's text item
> delimiters to {":"} -- means? I followed pretty much what was being
> done until there.
>
> Thank you!!
> Rosie
>
> On Mon, Nov 16, 2009 at 3:17 PM, Stockly, Ed <email@hidden> wrote:
>> Hi Rosemary,
>>
>>
>>>>> I'm trying to create a script that will search for 2 specifically named
>> pieces of artwork in an InDesign file and set every instance of that artwork to
>> overprint.
>>
>> Not sure what you mean by set to overprint, but here's something that may
>> help you get started:
>>
>> set listOfNames to {"foo", "bar"}
>> tell application "Adobe InDesign CS2"
>> tell document 1
>> tell page 1
>> set docGraphics to all graphics
>> repeat with thisGraphic in docGraphics
>> set graphicLink to item link of thisGraphic
>> set linkPath to the file path of item link of thisGraphic
>> set AppleScript's text item delimiters to {":"}
>> set linkName to the last text item of linkPath
>>
>> if linkName is in listOfNames then
>> set horizontal scale of thisGraphic to 110
>>
>> -- put your overprint command here--
>> end if
>> log properties of thisGraphic
>> --look in Script Editor's event log
>> --to see which image properites can be modified--
>> end repeat
>> end tell
>> end tell
>> end tell
>>
>> HTH,
>>
>> ES
>>
>>> Once it's finished, then save the file (to it's original location).
>>>
>>> I've got my ID dictionary open but I'm not sure how is the best way to
>>> find the artwork and do the change... ??
>>>
>>> I was planning on having the script attached to a folder action.
>>>
>>> Here's what I've stolen from one of my other scripts.
>>>
>>> tell application "Adobe InDesign CS3"
>>> launch
>>> set this_image to open file (source_file as string)
>>>
>>> --here is where i want to put the find specific file names with
>>> attribute overprint unchecked & change it's attribute to overprint and
>>> keep looping until it doesn't find anymore of the files names without
>>> overprint checked.
>>>
>>> close this_image saving yes
>>> end tell
>>>
>>> You're help is greatly appreciated.
>>>
>>> Thanks!
>>> Rosie
_______________________________________________
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