Copy link to clipboard
Copied
Need batch ID docs. & get all instances where the paragraph style "Codes" was applied, create a new layer "PR" & move text frames containing that paragraph style to a layer "PR". This what I have so far. Any help is appreciated. ================
set source_folder to choose folder with prompt "Select folder containing Indesign Documents to move codes to a diffrent layer"
tell application "Finder" to set theFiles to files of source_folder whose name extension is "indd"
if (count of theFiles) is 0 then
display dialog "No InDesign files to process" buttons "Cancel" default button "Cancel" with icon 0 giving up after 6
return
end if
end
--loop the selected folder
repeat with oneFile in theFiles
tell application "Adobe InDesign CS4"
--ignore dialogs
set user interaction level of script preferences to never interact
activate
set myDocument to open (oneFile as alias)
tell myDocument
--find pstyle
set myPstyle to paragraph style "CODES"
-- if the page is a spread
set x to properties of spread 1
set LayerName to "PR"
try
set myLayer to layer LayerName
set the properties of myLayer to {locked:false}
on error
--create layer if does not exist
set myLayer to make layer with properties {name:LayerName, layer color:red, visible:true}
end try
--get all instances where paragraph style CODES was applied only & move text frames to a PR layer
set myObjects to (every text frame whose applied paragraph style is myPstyle and item layer is myLayer)
move (every text frame whose applied paragraph style is myPstyle) to layer "PR"
close myDocument saving yes
display alert "Opening next document..." giving up after 2
--put the prefs the way it was
tell application "Adobe InDesign CS4"
set user interaction level of script preferences to interact with all
end tell
--==============
end tell --myDoc
end tell --Indesign
end repeat
Copy link to clipboard
Copied
Hi.
It works in Indesign CS6?
Regards,
Copy link to clipboard
Copied
Hi,
Textbox may contains many paragraphs (paragraph styles) know. can you explain clearly with screenshots?
Copy link to clipboard
Copied
Hi.
That's it.
Copy link to clipboard
Copied
In this case above I broke frames to ech specific p.style.
This way already ok!
But if is possible an break frame too.... much better!!!
Copy link to clipboard
Copied
Hi,
1. Above script is working for you?
2. Is the script move the frames to layer ??
3. What should you do now?
Copy link to clipboard
Copied
Hi,
Sorry,
1. Above script is working for you?
I did it manually (before and after).
Simply an example.
2. Is the script move the frames to layer?
Move frames to layer based from paragraph styles.
From defined paragraph to defined layer.
3. What should you do now?
What I did manually work from the script.
It's better now?
Thanks for your patience an calm!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Eg.
From Paragraph Styles AUTHOR and TEACHER to Layers AUTHOR and TEACHER.