Skip navigation
Ondrej Vyhlidal
Currently Being Moderated

How to check selected content on page

Jan 9, 2012 12:29 AM

Tags: #indesign #suite #selection #manager

Hi all,

I would like to create plugin that works with selected content on document. Plugin should do following: user selects some frame, graphic content that is placed on document. Than he opens my plugin and click on button. After button click I must check if something is selected (it would be only graphic items, not table and text), then I would like to get information (on which page is placed, is in the frame picture, dimension of frame...) from selected item. So I would like to ask you what is the best approach for that.

 

Right now I have selection manager and from that I get ILayoutSelectionSuite and dont know what to do next, I have been looking thru adobe documents, but didnt find any article about it...

thx

 
Replies
  • Currently Being Moderated
    Jan 9, 2012 2:05 AM   in reply to Ondrej Vyhlidal

    You will have to create your own selection suite and then get the selected page items. Once you get the selected pageitems UIDRef you can check for all the properties like its type, page it lies on etc. You will have to look into the sdk for different methods to get this information.

     

    Manan Joshi

     

    - Efficient InDesign Solutions -

    MetaDesign Solutions

    http://metadesignsolutions.com/services/indesign-development.php

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 9, 2012 9:17 PM   in reply to Ondrej Vyhlidal

    Yes this looks right on track, you need to create ASB and CSB for your selection suites and also make their entries in the fr file.

     

    In your case for layout selection you will place the ASB entry as an addin in the kIntegratorSuiteBoss and the CSB as addin in the kLayoutSuiteBoss class.

     

    Manan Joshi

     

    - Efficient InDesign Solutions -

    MetaDesign Solutions

    http://metadesignsolutions.com/services/indesign-development.php

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 10, 2012 12:59 AM   in reply to Ondrej Vyhlidal

    Hi Ondrej

     

    What kind of information do you need? For Layout Selection Boss you can get:

          - Item dimetions with IGeometry

         - type of item with IPageItemTypeUtils

          - item position in hierarchy with IPageItemTypeUtils

     

    and much more.

    Please specify what information do you need.

     

    Regards

    Bartek

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 10, 2012 1:36 AM   in reply to Ondrej Vyhlidal

    For  pageitem dimension you can use the IGeometry interface of the pageitem, for the image name you will have to traverse the hierarchy of the pageitem to find whether it contains any child or not.

     

    And to test whether your selection works or not query your selection interface from the active selection and call methods you have written inside it to see if you get the correct results.

     

    Manan Joshi

     

    - Efficient InDesign Solutions -

    MetaDesign Solutions

    http://metadesignsolutions.com/services/indesign-development.php

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 16, 2012 6:44 AM   in reply to Ondrej Vyhlidal

    Hi,

     

    Try to read the chapter called *Selection-Working with selection suites provided by the API-Calling a selection suite* in the Solutions.pdf.

     

    //p

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points