Working around the frame selection order issue in CS 4

Hi guys,
I'm trying to write a javascript in Indesign that will copy the contents of every selected text frame into the clipboard. The main problem is the selection order, since I'm using CS 4. I'm trying to work around the problem by writing the X and Y coordinates of every frame in arrays through a "for" loop, since the relevant order is always from top left to bottom right in my documents. However, I'm not sure what to do after sorting the arrays : how could I tell the program to use first the frame with the coordinates closest to 0, then the next, etc. ? So far I have this :
var LesX = new Array();
var LesY = new Array();
var Blocs = app.selection;
for (var i = 0; i < Blocs.length; i++) {
var myBounds = Blocs[i].geometricBounds;
var X = myBounds[1];
var Y = myBounds[0];
LesX.push(X);
LesY.push(Y);
LesX.sort(sortnum);
Thanks a lot for your help!
Ma

Ths is not a good approach. your LesX array will be something like [90, 50, 30, 60, 20] before the sort. And after the sort it will be [20, 30, 50, 60, 90]. But that will not tell you how to find the object whose X value is 20.
I would write it like this:
function byYX(a,b) {
    var
        aY = a.geometricBounds[0],
        bY = b.geometricBounds[0],
        aX = a.geometricBounds[1],
        bX = b.geometricBounds[1],
        dy = bY-aY,
        dx = bX-aX;
    return dy?dy:dx;
var blocs = app.selection;
blocs.sort(byYX);

Similar Messages

  • "Sharpen" effect produces white rectangle around the frame?

    I've been noticing this behaviour in CC 7.1.
    When you place "Sharpen" and some third party plugin (Sapphire, NewBlue, BorisFX, ...) the 1 pixel wide rectangle starts to appear around the frame.
    Is it a bug?

    Remove 3rd party effect from clip, see how that works.
    Or try nesting first then apply sharpen.

  • Has anyone solved or worked around the After Effects CC red flash frame glitch?

    I can't find any mention on any forums of the After Effects CC red flash frame glitch later than Feb. 2014. I just installed 12.2 (which was my first CC version) on my macpro and started getting the red flash frames randomly, but with increasing frequency, in my projects. I have never had this problem before on any previous computer or version for AE. The forums I've read have referenced ProRes source footage, outputs to ProRes, and lens blur. My project uses all of these things.
    If there is a universally accepted solution/work around, I haven't seen it definitively. Do I not use ProRes source footage? Do I not render to ProRes 4444? Do I not use the lens blur effect? Do I give up and go back to CS6?

    Hi Keith,
    I have the "same" issue with the red frames in AFX CC
    I have seen them first, as I resized a prores4444 HD to a smaller format and saw the redframes in the preview window.
    Setup in AFX: I created a comp from the HD Prores4444 footage and put this comp in a comp with resolution of 960x540.
    The output format was again prores4444.
    I shuttled through the clips in the small comp and I saw the red frames too.
    When I switched to the HD comp at the same position everything was fine.
    I "solved" the problem by flushing the cache, twice. Because after the first purge I was only able to render the first clip. The second one had the red frame problematic again.
    Maybe It has something to do with hardware accelerated layers.
    I'm using a MacPro running OSX 10.8.5 with a Nvidia GTX680.
    Cheers
    Michael

  • Work-around The Whine: why does this work? And is it BAD?

    Hello everybody, sorry to bring up The Whine again, but I was wondering if anyone can figure out why the following trick works to eliminate the noise.
    Also, could doing this regularly (all the time, basically) potentially be bad for the system in any way?
    This is the work-around I've been using:
    1. Open Photobooth, then Force Quit that application (you must Force Quit rather than simply quit)
    2. Put the Macbook to sleep, waiting a few seconds until the indicator light starts pulsing.
    3. Wake up the computer.
    Voila. That always does the trick, eliminating the whine until either the next time I boot up or the next time I open and quit Photobooth in the normal way.
    I suppose force quitting may keep the processor slightly busy somehow?
    Don't know...

    John P.,
    You say that all the notebooks that you know of make
    some kind of noise. How many notebooks is that? Not
    trying to be a jerk or anything but it better be like
    dozens and dozens to make this claim. I have heard
    the exact opposite of this claim from users that have
    owned a few notebooks as well.
    Hi Jerome,
    No problem... I'll clarify..
    5 notebooks personally, so when I say "all notebooks that I know of", it's a true claim because that is exactly what I'm saying.
    If this noise is caused by capacitor that is at some
    miniature threshold then why does the noise go away
    when said remedies are employed? Does the capacitor
    get bigger? Doesn't make sense but I appreiate that
    you want to reassure original poster.
    Actually I may have misspoken--it may be called a "voltage regulator" and it sits directly West of the CPU and controller chip. They do make noise and from what I have been told and remember, they can dampen it w/ a capacitor but that's about it. It's just the nature of the beast for that type of component, I'm told.
    What "I" think it may be is the power fluctuations, or lack thereof, in the Intel chip causing it--when you put a load on it, there's a power fluctuation because your CPU usage is going up/down a little bit, but when you're not doing anything it's very little it causes it to make a little noise. No big deal, but just as long as it's not blaring in your ear when you're trying to use your computer. My ZV6000 does the same thing, but it doesn't matter when you've got a load or not--seems to do it more when I have Cool 'n' Quiet enabled.
    This is not right. I am sorry.
    If this noise is normal then I'll take no MacBook.
    You know it is being fixed apparently on the MacBook
    Pros by motherboard replacement.
    I never said anything about pro. I don't own one, nor have I used one. I can't say how profound in comparison to the Macbook (non pro) it is.
    I'm sure if Apple thought it was a big enough problem, they would act either more quickly about it, but it's not stopping me from checking my e-mail or going on the Web.

  • Number emails from iCloud...per day. I need a work around the restriction

    I use a MacBook Pro, lots of memory, drive space etc. That is not the problem. I am the President of a Mac club, 749 members and membership person of our fishing club, 78 members. I send out many emails each day. iCloud prevents me from sending due to the restriction they place on iCloud. Anyone have a work around?

    The backup is encoded as a SQLite database.  It can't be read without special software.  All the "files" you see inside the backup file are different components of the backup, not different backup files.  I believe the reason that not all the dates match the date of the backup is because the backup file components are only updated when you sync rather than recreated from scratch, so not all the components are new.
    To read and extract data from the backup you have to use 3rd party software such as iPhone Backup Extractor.

  • How to work around the java runtime bug -The indentation is overridden

    Hello all,
    I generate xml from a servlet and stream to client as the following code. It works fine in my local machine (The xml is indented nicely) but when the war file deployed on a geronimo server 2.0.2. (It uses java 1.5.0_16). The xml streamed out without indentation
                   response.setContentType("application/xml");
                   response.setHeader("Content-disposition","attachment; filename="+fileName);
                   // set up a transformer
                   TransformerFactory transfac = TransformerFactory.newInstance();
                   Transformer trans = transfac.newTransformer();
                   trans.setOutputProperty(OutputKeys.METHOD, "xml");                
                   trans.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                   trans.setOutputProperty(OutputKeys.STANDALONE, "yes");
                   trans.setOutputProperty(OutputKeys.VERSION, "1.0");
                   trans.setOutputProperty(OutputKeys.INDENT, "yes");
                   trans.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
                   // create string from xml tree
                   DOMSource source = new DOMSource(doc);
                   ServletOutputStream os = response.getOutputStream();
                   OutputStreamWriter w = new OutputStreamWriter(os, "UTF-8");
                   StreamResult result = new StreamResult();          
                   result.setWriter(w);
                   trans.transform(source, result);This is the bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6337981 (The indentation is overridden)
    I tried the work around suggested there by using OutputStreamWriter, it doesn't help.
    (I cannot change anything on the server. I have to accept whatever in the server)
    Please help
    Thank you
    Edited by: mycoffee on Jun 10, 2011 8:16 AM

    You have to set the indent level on the factory, see bug #6296446. This only affects 1.5; 1.6 allows you to set the indent level on the transformer, as you did (and for cross-version compatibility, setting it on both doesn't hurt).
    transfac.setAttribute("indent-number", Integer.valueOf(4));

  • What can I do to get my slice action to work. "the command "select" is not currently available"

    "the command "select" is not currently available"...well it should be. I just used to two seconds ago. 
    I routinely can not perform most actions because some function is not available. If I open an image, and record a simple "divide slice" action, the action can not repeat it, even on the same image. What am I missing? it seems so trivial, but I can't get past it.
    photoshop CS6 extended.

    Photoshop has may select commands please post the action and a screen capture of the error showing photoshop window containing the image window and photoshops paletts  with the action expanded in the action panel showing.
    Supply pertinent information for quicker answers
    The more information you supply about your situation, the better equipped other community members will be to answer. Consider including the following in your question:
    Adobe product and version number
    Operating system and version number
    The full text of any error message(s)
    What you were doing when the problem occurred
    Screenshots of the problem
    Computer hardware, such as CPU; GPU; amount of RAM; etc.

  • Working Around the Mentioned Limitation

    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1574568
    This note states the following u2026.. And this is what we have to do in the upcoming requests..... We have to change the BAPI's related to Purchase order create and Sales Order Create (use wrapper RFC's around them ).
    b) Deep Insert
                           Deep Insert according to OData specification, which means inlining an associated entry (which can theoretically have inlined entries itself) to be created in conjunction with the sorrounding entry, is not supported. Example: create a Purchase Order with a Purchase Order Item in one request.
                           As a consequence of that, in the BAPI/RFC Generators, you cannot map structure or table input parameters to Data Objects below the Root, even if they are mandatory for calling the respective BAPI/RFC.
                           You can either map (i.e. flatten) the fields of a structure parameter to root Data Object properties or assign custom constant values to them.
                           For table input parameters, there is no workaround, i.e. respective BAPIs/RFCs can't be used.
    Do you think we will have to solve it on the backend itselfu2026 but how??..what would you suggest as the solution if we hit this limitation in upcoming projectu2026.(highly likely) Basically how do we associate two entities, if we are working on two different entities in case of a CREATE and Update u2026 ??
    Can you suggest me some approaches here ....
    Regards,
    Ravi Sharma
    Edited by: Ravi Sharma on Sep 7, 2011 5:38 PM

    Hi Ravi,
    Deep Insert is supported as of SP2 with the OData Channel programming model.
    http://help.sap.com/saphelp_gateway20sp02/helpdata/en/63/b45e1756d94c748affe4282fd3ff55/content.htm
    Best Regards,
    Andre

  • Is collection detection for caldav in the works for the lightning extension? Issue with lightning integration with multiple collections.

    Hello, i currently have a server running davical which serves my users' calendars, currently users which wish to use thunderbird and do not want to use the web interface for calendaring (and wish to use lightning instead) have to add each collection seperately, rather than just provide the base URL of their calendar info.
    So instead on most calendar clients putting this as the calendar address:
    davical_base_url/caldav.php/username/
    and be done with it, they have to go through the new calendar wizard for each calendar/todo collection, and cannot easily create collections from within the lightning user interface, instead have to resort to either the calendar interface or the davical server interface to create/manage collections. They also have to figure out what the names of the collections are under davical, automatically generated collections have a large UID name instead of the example collection names. I.e. they have to add a bunch of URL's like this individually as calendars:
    davical_base_url/caldav.php/username/work/
    davical_base_url/caldav.php/username/personal/
    davical_base_url/caldav.php/username/worktodo/
    davical_base_url/caldav.php/username/personaltodo/
    davical_base_url/caldav.php/username/8302E5D8-3630-419E-BCFC-A6A144D292C8/
    Are there any workarounds for this or is it in the works? other calendaring applications in the ecosystem haven't had an issue, Android is fine, iOS is fine, CalDavZAP is fine.
    Hopefully someone can help,
    Cheers.

    Hi all,
    Just curious if anyone was able to solve this.
    We experienced the same issue in both NW2004 (SP 20) and NW2004s (SP11).
    Through trial and error, I disabled the portal integration flag, and the InputHelpV2 started working perfectly.  Decided to search SDN this morning to see if anyone else had run across this, and this post was right on the same issue.
    When the portal integration flag is enabled, and you perform the F4 dropdown...your browser seems to hang, and no popup window is displayed until you click in the browser window with your mouse.  Once you click in the window, a tiny small InputHelpV2 window pops up, but it isn't functional (i.e. you can't highlight a row, and click on the check mark without getting an IE error (Access is denied)).
    Best Regards,
    Chris Cassidy

  • HT201272 hi all, I am having trouble downloading 2 music videos. I keep getting the download error 8008. Can anyone enlighten me on how to work around the problem.

    Hi guys, I'm havinh trouble downloading 2 music videos. The download starts then stops before it gets going and gives me an error code, 8008. Can anyone help please.

    Try the troubleshooting for that error number on this page : http://support.apple.com/kb/TS3297
    "Error -50," "-5000," "8003," "8008," or "-42023"
    These alerts occur due to timeouts or conflicts trying to write a file during download.
    If you encounter this issue while accessing iTunes Store:
    See iTunes 9: "One Moment Please" or "Error (-50)" message when accessing iTunes Store
    If you encounter this issue while while downloading something from the iTunes Store:
    Delete your iTunes Downloads folder, located in:
    Mac OS X:
  ~/Music/iTunes/iTunes Media/Downloads   Note: "iTunes Media" may appear as "iTunes Music. Also, the tilde (~) refers to your Home directory.
    Windows Vista:
  \Users\username\Music\iTunes\iTunes Media\Downloads\
    Windows 7:
  \Users\username\My Music\iTunes\iTunes Media\Downloads\
    Windows XP:
  \Documents and Settings\username\My Documents\My Music\iTunes\iTunes Media\Downloads\
    After locating your iTunes Downloads folder:
    Quit iTunes.
    Delete the Downloads folder on your computer.
    Open iTunes.
    Choose Store > Check for Available Downloads.
    Enter your account name and password.
    If you encounter this issue while while downloading Digital Copies using Windows:
    Use MSCONFIG (directions for Windows XP and Windows Vista/Windows 7) to disable conflicting software.
    If using MSCONFIG steps resolves the issue, you may want to use the System Configuration Utility to turn on the third-party System Services and Startup Items one at a time (restarting your computer after turning on the item or items) to identify which System Service or Startup Item is causing the conflict.
    You can turn all of them back on by selecting the Normal Startup option under the General tab of the System Configuration Utility window, but please note that this may cause the issue to reoccur.
    If you are able to isolate the issue to a particular third-party software, you may wish to contact them to let them know of the conflict.

  • Home and Work Printer the same - causing printing issues

    I have a Photosmart Plus as my main printer in the office.  I really liked it so purchased the same model for home use.  However, any documents I have created/saved on my home computer will not print on my work printer (and vice versa). 
    Any thoughts?

    The pdf test is meant to see if the problem lies with Word.
    Take a look at this kb support doc from M$.
    Please mark the post that solves your issue as "Accept as Solution".
    If my answer was helpful click the “Thumbs Up" on the left to say “Thanks”!
    I am not a HP employee.

  • Differences in the object selection order with Select Same and Key Objects

    If you manually select multiple objects using Shift, the first object you select becomes the Key Object for alignments. If you use the Select Similar command, it's the last object. Shouldn't this be uniform between the two methods?

    I have this same issue... HUGE problem and I can't seem to solve it.  Anyone in the same boat?  Solutions?  Thanks in advance for any help!

  • My ipod 4g is disabled and my laptop has crashed.i am using a new laptop and it(laptop) is not working with the ipod in order for it to be working again(ipod). what should i do??

     

    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    Also:
    If you don't have access to a computer
    If you are using Find My iPhone, you can use Remote Wipe to restore your device. If you have been using iCloud to back up, you may be able to restore the most recent backup to reset the passcode.

  • Another solution that worked for the iOS 6 WiFi issue...

    After the iOS 6 install my wifi connect just wouldn't connect anymore. I tried everything in the book. I was even changing settings on my router at one point. Nothing worked. It would connect for a second, drop off and then try to bring up a login screen from Apple.com with the message "Page cannot be found."
    This is weird but it solved my problem both on my iPhone 4S and my iPad 3:
    Settings>Safari>Clear History
    Settings>Safari>Clear Cookies and Data
    Hold down the Sleep button until it brings up the Power Off slider. Power off and then turn on again.
    Reconnect to wifi network using Settings>Wi-Fi
    Now everything is hunky dory. Super weird!

    Thanks for the suggestion. I followed them to the letter. I have a time capsule and a base station. I switched the time capsule as you suggested. I got rid of the previous connection on the ipad and connected. At first when it started I had full bars. I walked to the opposite side of the house (2000 sq. ft house) was going strong and it dropped to one bar. If I turn the ipad off for awhile full strength comes back. Unfortunately, in my experience no joy.

  • My Mac Mini no longer "sees" my digital camera since upgrading to Maverick. I have a Samsung DV300F connected via USB. I have tried to work around the connection by having the camera join the wireless network I can connect to, but I still cannot "see" it.

    Any suggestions?

    Try unplugging the camera, turn it off and on again, plug it back in, and open the Image Capture application.
    If it doesn't appear in the sidebar, try opening iPhoto, and then iMovie.
    If none of them show it, you might need to reinstall the drivers for the camera.

Maybe you are looking for

  • "Save AS" in another window

    Hi all, I use the following to prompt a save as dialog box : response.setContentType("image/svg+xml"); response.setHeader( "Content-Disposition", "attachment; filename=" + filename); It works, but as the file to open is a svg file (xml file), it is o

  • Email submit

    Is it possible to email a PDF to 2 different people in 2 different formats? From a single user click on a Submit button I want to: 1. Silently email a copy in XDP format to a predefined addressee. 2. Bring up Outlook with the PDF document attached an

  • Texting no sound sending and recieving...

    Why is it when I send a text I don't hear the sound or when recieving text.

  • 6110 Contacts and Calendar Birthday events

    I have recently got a 6110 Navigator but am having difficulty with the calendar. The birthdays I introduce on my contacts does not appear on the calendar. I have read the manual but it does not indicate anything in particular about these fields. Is t

  • Upgrading InDesign 5.0 to 5.5 question

    We are thinking of upgrading from InDesign 5.0 to InDesign 5.5 and wanted to double check some information. As I understand it, if we upgrade, the installer installs version 5.5 and the 5.0 version still remains (i.e. it doesn't write over or elimina