[JS CS3] Touching Objects

Hi
Is there a way to obtain all objects who are touching a certain frame on a page?
Thanks for answers
Stefan Huwiler

Stefan Huwiler wrote:
I was thinking about such a way too, but was interested if there is maybe another way.
I thought InDesign internally knows what objects are overlapping or upon another.
Thanks für the answers.
It's not so simple. The 'bounds' property deals with bounding box disregarding the inner path of the object (polygons, ovals, rotated or sheared frames).
1) If 2 bounding box have no intersection, you are sure that the 2 underlying objects don't intersect.
but
2) If 2 bounding box intersect, you are not sure that the 2 underlying objects intersect.
In a recent project I had to check for touching polygons.
The 'bounds' approach provides a quick diagnostic when the conclusion is "no intersection":
/*bool*/ Polygon.prototype.collideBounds = function(/*Polygon*/ _poly)
// Ret. TRUE if the bounding boxes intersect, else return FALSE
// quick method, but TRUE does not mean the shapes actually intersect
var b = this.visibleBounds;
var _b = _poly.visibleBounds;
return( !((b[0]>_b[2]) || (b[2]<_b[0]) || (b[1]>_b[3]) || (b[3]<_b[1])) );
When p1.collideBounds(p2) is TRUE, I need to invoke another method to refine the test. Then I use the intersectPath method, which is dramatically slower:
/*bool*/ Polygon.prototype.collideShapes = function(/*Polygon*/ _poly)
// Ret. TRUE if the shapes intersect
// slow method
try     {
     this.intersectPath(_poly);
     app.activeDocument.undo();
     return(true);
catch(ex)
     return(false);
As shown above, the point is that p1.intersectPath(p2) throws an error when the 2 shapes don't intersect.
Hope it could help you.
@+
Marc

Similar Messages

  • LR 2.1 Softproofing with CS3 Smart Object

    I have seen Jeff Schewe use a duplicate of the image to smart proof at least until Adobe gets this in LR (Can't Wait!) but some discussions say edit in a smart object.
    What advantage does this have over the way Jeff does this and is it done the same way with a duplicate image?

    My problem might be of a similar origin.
    I have also posted it on a different thread http://www.adobeforums.com/webx/.59b6903c
    I use mostly Hebrew characters for Keywording (the file names are in English) after opening in CS3 and saving, the keywords are converted from Hebrew fonts to accented fonts like åäöÅÄÖ.
    This didn't happen in LR1 and does not happen if I use CS3 as my secondary editor (not using the new LR2 edit in CS3 functionality)
    Shai

  • PS CS3 - Smart Objects are "Jaggy"

    I've been trying to copy/paste some vector art from Illust CS3 into PSCS3. Regardless of what option I select (Smart Object or Pixels), the artwork comes in jaggy. Tried the same thing in CS2 and had no problems.
    I checked the clipboard prefs in both apps, and tried a search on this forum w/o luck.
    What am I missing?
    Thanks in advance!
    Bryan

    Hello,
    I am having the exact same problem with CS3 - did this get resolved? What does 'trashing' your prefs mean and does any one have settings for correct pref for PS and AI - I would love you forever if someone could sort this for me, bloody deadlines and technology
    Much love.x x

  • PS CS3 - Smart Objects resizing when updating resolution! Help!?

    My company has built many multi-layered files using Smart Objects in CS2. When in the past we have made resolution changes to the smart objects and updated them in the parent file, they have stayed at the same size, with only the resolution changing.
    Now, when opening in CS3 and performing the same action, the Smart Objects now re-size to match the parent file's resolution and the height and width changes!
    Has anyone else experienced this?
    It is quite disturbing that this feature has changes since we have come to rely on it in CS2.

    Yes I've tested this in both CS3 and CS4 - you are right, the problem you describe happens in both. Your problem was very well described.
    Duplicating linked layers has always been a little odd in the way it behaves (ever since grouping and nested grouping was introduced) - it seems to be that it can't hold complex linked relationships when duplicating the layers.
    No solution at present I'm afraid

  • [JS CS3] RegExp Object containing only one backslash (how to escape)

    Hi
    I'm trying to escape one backslash in my RegExp Object, but I get a Syntax Error:
         myObj = new RegExp ( "\\" );
    I tried it phyton Style   myObj = new RegExp ( "\\\\" ); but that's not working right.
    Thanks for any hint.
    Stefan

    Stefan,
    First of all, in your sample text you need to escape your backslash as well:
    myText = "This is an \\ of search and replace.";
    You can see this in these examples:
    alert ("a\rb") prints "a" then "b" on a new line; alert ("a\\rb") prints "a\rb".
    Another problem is that you use a regex as the replacement object (myWhit), but that should be a string. With these two things corrected, it works fine:
    function main()
         var myText = "This is an \\ of search and replace.";
         var myWhat = new RegExp ( "\\\\" );
         var myWhatSearch = new RegExp ( "\\\\" );
         var myWhit = "example";
         alert( myReplaceExample( myText, myWhatSearch, myWhat, myWhit) );
         return true;
    That new RegExp ("\\") can't be correct can be seen if you start with a literal regex, in which you would use an escaped backslash:
    myText = myText.replace (/\\/, "example")
    To use \\ in a new RegExp () construction, you need to place it in a string, and you need to escape both backslashes, so you end up with "\\\\".
    Peter

  • CS3 - Placed objects are duplicated to temp

    hi,
    I am placing a PSD document into my document. And PS CS3 creates a copy of my document in App data / temp.
    I had pointed to a document in my project folder, but it is not linked with the original anymore.
    What is the problem?
    thnks!

    Photoshop placed document support doesn't link to the original file - it embeds the original file.
    And to edit that embedded data, you have to put it on disk somewhere (like temp).

  • CS3: Applying Object styles not always consistent

    Hello,
    I have a number of Object Styles, each of which have different Paragraph Styles called out. In turn, each of these Paragraph Styles calls out different fonts, font styles and sizes.
    Most of the time I can click on a text frame and all the parameters in the Object style are applied--just as it is supposed to be.
    But sometimes the font that the text is supposed to change to does not get applied. This seems to be inconsistent but there is probably an underlying order to it that I do not see.
    So why would an Object style not apply the Paragraph style that is called for in the Object style options?
    Thanks,
    Tom

    I now see the problem, though I do not know the solution.
    If I open up a new document and create a text frame, the font is that old ugly but familiar Times-Roman 12 point.
    But if I open up the template where I have many object, paragraph and character styles, one of each of these is already selected. I can either see this by opening the respective panels or above in the control panel. In fact, any text frame I create always has a top text inset.
    So my Preferences in general are OK and I'd rather not dump them. The problem is that styles are already selected upon opening this one ID file. How do I turn that off?
    In  answer to a question above, I do not simply redo the old Quark file, now in ID. I have a series of styles that are just much easier to apply in a separate ID file, rather than reinventing them in the Quark-to-ID file.
    Thanks for your questions and ideas. They helped me probe this deeper. Now I just need a solution to what I think is a simple problem (still eludes me tho!)
    Tom

  • [CS3] Getting object style used by a page item

    If I have a UIDRef of a multi-column text frame, how can I get the object style applied to it? It looks like there was a thread on this previously but it seems to have been pruned from the list.
    Thanks.

    IID_IOBJECTSTYLEINFO
    For setting, you will need kApplyObjectStyleCmdBoss, the IID_IUIDDATA points to the style. As that command does not update the attributes, you'll also need a bunch of other commands, I'd watch out for a Facade instead.
    Dirk

  • Howto Poster (Preview) Frame on CS3 VideoPlayer object

    I am new at this. DW-CS3. I have the DW Video Player
    (progressive) which I enabled from the INSERT menu on the Index
    page (the opening page) on my website. The Player is now a BLACK
    rectangle on the webpage with a control bar at the bottom. This
    BLACK rectangle is very UGLY and turns people off when they first
    log on to my website.
    I would grateful if an experienced person to advised me how I
    can use whatever commands on DWCS3 (perhaps in the INSERT menU) to
    cause a static image to appear on top of the video player so that
    when a visitor click on it the video begins to stream and enjoy the
    movie at that point.
    I have search and have seen some comments but nothing that I
    understand. Nothing as straight forward as a couple of menu clicks
    and pointing to a *.jpg file for example. And also from the
    comments I have read I do not know if they are talking about MX
    2400 or CS3 and besides the explanations were way over my head.
    To see an example of what I would like to "happen" in the CS3
    video player, go here:
    http://www.futurehome.tv/Realtors/Michael_Laprairie/284kincoraheights/284flash.html

    Transparency flattening REQUIRES having access to the high-resolution images to get good results. One of the slogans I teach printers is "Fatten before you flatten." Meaning, replace the low-res images with high-res images.

  • InDesign CS3 art object ghosts on colored background when printing

    I am trying to print out an imported graphic logo (with a drop shadow) in over a color and it keep ghosting when i print it to printer and as a pdf.There is a halo around the image over the colored box below it. I have put the graphic on a separate layer in inDesign this hasn't corrected the problem? Any ideas how to fix this?

    http://indesignsecrets.com/eliminating-ydb-yucky-discolored-box-syndrome.php
    Bob

  • ExtendScript2 CS3 Object Model Viewer (very complicated - any alternative viewer ??)

    hallo iam just starting with JavaScript in CS3 and what i found most confusing is the Adobe's Object Model Viewer in ExtendScript2...
    its no help whatsoever and i didnt figure out the logics of the various dictionary items listed, whatsoever...
    if this is currentlly the only complete reference to CS3 JavaScript model than god help us....
    the ExtendScript2 Object Model Viewer needs to be COMPLETELLY REWORKED to become a full powered dictionary tool instead of an unorganized pile of items
    have you tried InDesign CS3 AppleScript Dictionary in Apple's ScriptEditor... thats a dictionary of object model as i would imagine
    1) its FULLY tree-structured dictionary from topmost level down
    2) all items are categorized and sorted BY TYPE using various icons
    3) every item has a properties catalog card with nice english explanations of that function with hyperlinks to all other relevant items
    IS THERE ANY ALTERNATIVE TO VIEW CS3 JAVASCRIPT OBJECT MODEL AND NOT USE THE EXTENDSCRIPT2 WEAK VIEWER ?????

    Hi Rosta,
    I have to admit that I don't understand. I see very little difference between the ESTK object model viewer and the AppleScript dictionary viewer. If anything, I think the ESTK version is superior because it connects methods with their objects--something that the AppleScript viewer doesn't do at all. But I pretty much find them equivalent.
    Regardless, the descriptions are *identical* between the object model viewer in the ESTK, the AppleScript dictionary viewer, and the Visual Basic/VBA object browser. All descriptions come from the scripting resources in InDesign, and all languages use the same description string.
    Jongware's HTML version, however, is much better than any of the above. Its hyperlinking is very good, and everything else can be found with your browser's Find command.
    Relying on the object model viewers has freed me from the task of maintaining the reference PDFs--which was taking almost all of my time. Without that burden, I can focus on writing the Scripting Guides, Scripting Tutorial, and example scripts. While I agree that the object model viewers aren't perfect, I believe that this is a better use of my time. I think that scripting examples are more useful, overall, than reference documentation (which simply repeats the information from the scripting resources, in any case).
    One very nice thing--because we have to rely on the object model viewers, we were allowed to fix literally hundreds of errors in the descriptions in the scripting resources.
    Thanks,
    Ole

  • Frame fitting options in object styles

    We are producing multiple pages using tagged templates and importing xml - to populate both text and images.
    Back in CS3 - our object styles using frame fitting worked perfectly. Since we have upgraded to CS5 and now CS6 - when xml is imported the frame fitting element of our object styles are no longer being honoured - when clicking on the object frame, it shows the style has been applied but with overrides - and it is adding random offsets to the frame fitting crop settings.
    We are producing large numbers of pages through xml automation, therefore it's very time consuming to open every page and clear overrides/reset frame fitting on every affected graphic.
    I've seen on other questions/forums that this may be a known bug - anyone have any up-to-date info on fixes or workarounds?
    Thanks for your help :-)

    Hello,
    We have a free startup script that clears the overrides after a place action.
    http://www.kerntiff.co.uk/free-stuff/afterplaceobjectreseter
    P.

  • Where are the data-binding frameworks for Oracle Objects?

    Oracle offers a few different options for data-binding frameworks to Oracle relational data. Amongst them they include TopLink and the Oracle Application Development Framework (ADF)in JDeveloper 10G. J2EE also offers the EJB standard framework. Both of the Oracle data-binding frameworks appear to work well with relational data but fail miserably when one tries to work with a fully fledged Oracle Object-Relational schema. I have spend much time with ADF but have not been able to create successful bindings to Objects with nested complex objects (such as a 2-level nested object) or objects containing nested tables. TopLink will not even touch Object tables.
    Have other people being more successful with this? Do we have to implement our own data binding framework? Does Oracle plan on improving these frameworks to fully support Oracle Objects?

    TopLink Runtime supports both fully fledged OX mappings and nested complex objects. These mappings can be setup in the code.
    TopLink ADF design time however currently does not have support for OX mappings.
    Hope this helps,

  • Where are the Oracle Data Binding Frameworks for Oracle Objects?

    Oracle offers a few different options for data-binding frameworks to Oracle relational data. Amongst them they include TopLink and the Oracle Application Development Framework (ADF)in JDeveloper 10G. J2EE also offers the EJB standard framework. Both of the Oracle data-binding frameworks appear to work well with relational data but fail misserably when one tries to work with a fully fledged Oracle Object-Relational schema. I have spend much time with ADF but have not been able to create successful bindings to Objects with nested complex objects (such as a 2-level nested object) or objects containing nested tables. TopLink will not even touch Object tables.
    Have other people being more successful with this? Do we have to implement our own data binding framework? Does Oracle plan on improving these frameworks to fully support Oracle Objects?

    TopLink Runtime supports both fully fledged OX mappings and nested complex objects. These mappings can be setup in the code.
    TopLink ADF design time however currently does not have support for OX mappings.
    Hope this helps,

  • OpenGL 3D touch detection

    Hey, so I might be completely stupid and missing something big, or I just suck at googling.
    I've built a 3d interface on the iphone where you can move in the world like a 1st person shooter. I've been wanting to implement a feature where the user can touch objects in this interface, and the objects are then selected and a description of it pops up.
    I know how to grab UITouch events, but what I need to be able to do is interpret those touches and figure out which polygon, if any, was selected on screen.
    I see how this would be an easy problem if the interface was 2d. You could just set your view to map 1 to 1 from opengl to cocoa touch pixel points.
    My problem is that when you are shifting perspectives like in a 3d interface, how do you detect if a touch selected a polygon on screen.
    Hope this wasn't too vague. I someone could send me a link or offer some advice, or anything, it would be appreciated.
    Thanks

    OpenGL used to have a "picking" feature that would do this for you, but that's not present in OpenGL ES. It was a pain to use anyway.
    You'll have to do your own picking, i.e. cast a ray from the eyepoint, through the point on your projection-plane that corresponds to the point touched on the screen, and collide that ray against your world to see what it hit.

Maybe you are looking for

  • Data Pump query

    Just started looking at data pump yesterday and it seems like a great tool. I've been no issues in getting data transferred between databases and mapping to original tables. However I have refactored a couple of parts of my db and hoped I could get a

  • Analyzer for MSA??

    Hi, I came to know that there is a tool called UF Analyzer for MSA for viewing the log messages. How can use this? Is it a separate tool to be installed on the MDW? Is this tool used only for MDW or can I use it for Mobile client as well? I'm using M

  • ICal appointments and invites

    I am using iCal for booking appointments, when I book the original appointment it sends an invite to the invitee. If I then move the appointment it doesn't send a notification of the change. How do you get it to send the change

  • Which Oracle ADF Essentials Files To Deploy

    I am using ONLY the ADF-Faces  from ADF-Essentials. Could someone tell me which of the following jars below, I need to add to my ear deployment. They are an overkill in comparison to others such as trinidad, primefaces, richfaces, icefaces, etc. Plea

  • Purchasing Adobe madter collection as a teacher

    As a teacher I purchased the Adobe master collection for my personal use on a PC. I am now considering buying a Mac but would need to purchase the Adobe collection again. All purchasing options seem to be on plans where I need to pay a monthly fee.ho