• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Move text frame to a layer

Community Beginner ,
Feb 24, 2015 Feb 24, 2015

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

TOPICS
Scripting

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 12, 2017 Oct 12, 2017

Copy link to clipboard

Copied

Hi.

It works in Indesign CS6?

Regards,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 12, 2017 Oct 12, 2017

Copy link to clipboard

Copied

Hi,

     Textbox may contains many paragraphs (paragraph styles) know.  can you explain clearly with screenshots?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 12, 2017 Oct 12, 2017

Copy link to clipboard

Copied

Hi.

Screen Shot 2017-10-12 at 1.03.01 PM.pngScreen Shot 2017-10-12 at 1.04.37 PM.png

That's it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 12, 2017 Oct 12, 2017

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!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 13, 2017 Oct 13, 2017

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 13, 2017 Oct 13, 2017

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 13, 2017 Oct 13, 2017

Copy link to clipboard

Copied

LATEST

Hi,

     check the below url. Its working...

MacScripter / Move text to a layer

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 12, 2017 Oct 12, 2017

Copy link to clipboard

Copied

Eg.

From Paragraph Styles AUTHOR and TEACHER to Layers AUTHOR and TEACHER.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines