Need to avaid placing floats one after one on the same place

Hi All,
I have written a script for placing floats after the citation it works only for either the figure or table. But if both figure and table citation comes on the same place the script placing the floats one on one.
How to control this?
Thanks in advance,
Learner

Hi Vandy,
It is a xml workflow.
Here is the script.
function caption(){
    this.name = "caption";
    this.xpath = "//caption";
          this.apply = function(caption,){
        with(caption){
            var mydoc = app.activeDocument;
            var pwidth = mydoc.documentPreferences.pageWidth;
            var pheight = mydoc.documentPreferences.pageHeight;
            var topmargin = app.activeDocument.masterSpreads.item(0).pages.item(0).marginPreferences.top;    
            var bottommargin = app.activeDocument.masterSpreads.item(0).pages.item(0).marginPreferences.bottom;
            var insidemarginfirstmaserpage = app.activeDocument.masterSpreads.item(0).pages.item(0).marginPreferences.left;
            var outsidemarginfirstmaserpage = app.activeDocument.masterSpreads.item(0).pages.item(0).marginPreferences.right;
            var y1 = topmargin;
            var x1 = outsidemarginfirstmaserpage;
            var y2 = pheight - bottommargin;
            var x2 = pwidth- insidemarginfirstmaserpage;           
            citpage = figCitationPage.name;
            textfm = placeIntoFrame(app.activeDocument.pages.item(citpage), [y1, x1, y2, x2]);
            textfm.fit(FitOptions.FRAME_TO_CONTENT);
            textfm.appliedObjectStyle = mydoc.objectStyles.item("oSlug");
            mydoc.xmlImportMaps.add(mydoc.xmlTags.item("caption"), mydoc.paragraphStyles.item("Slug"));
            mydoc.mapXMLTagsToStyles();
            textfm.textWrapPreferences.textWrapMode = TextWrapModes.BOUNDING_BOX_TEXT_WRAP;
            textfm.textFramePreferences.ignoreWrap = true;
            var textfmy1 = textfm.geometricBounds[0];
            var textfmx1 = textfm.geometricBounds[1];
            var textfmy2 = textfm.geometricBounds[2];
            var textfmx2 = textfm.geometricBounds[3];
            figfmy1 = figfm.geometricBounds[0];
            figfmx1 = figfm.geometricBounds[1];
            figfmy2 = figfm.geometricBounds[2];
            figfmx2 = figfm.geometricBounds[3];
            textfm.geometricBounds = [textfmy1,textfmx1,textfmy2,x2];
            textfm.move([textfmy1, figfmy2]);
            textfm.fit(FitOptions.FRAME_TO_CONTENT);
            var myPage = mydoc.pages.everyItem();
            var myArray = new Array;
            myArray.push(figfm);
            myArray.push(textfm);
            var t = (textfmy2-textfmy1)
            var groupitem = figCitationPage.groups.add(myArray);
            var citbaseline = exbm - citpos;
            var test = parseInt(citpage)
            var citbaseline = exbm - citpos;
            var test = parseInt(citpage)
            if (citbaseline<groupitem.geometricBounds[2]){
                    groupitem.move(app.activeDocument.pages[test]);
                    groupitem.move([x1,y1])
            else {
                    var by1 = groupitem.geometricBounds[0];
                    var by2 = groupitem.geometricBounds[2];
                    var t = (by2-by1)
                    groupitem.move([x1, (y2-t)])
        return true;
function figure(){
    this.name = "figure";
    this.xpath = "//figure";
          this.apply = function(figure,){
        with(figure){
            var mydoc = app.activeDocument;
            var pwidth = mydoc.documentPreferences.pageWidth;
            var pheight = mydoc.documentPreferences.pageHeight;
            var topmargin = app.activeDocument.masterSpreads.item(0).pages.item(0).marginPreferences.top;    
            var bottommargin = app.activeDocument.masterSpreads.item(0).pages.item(0).marginPreferences.bottom;
            var insidemarginfirstmaserpage = app.activeDocument.masterSpreads.item(0).pages.item(0).marginPreferences.left;
            var outsidemarginfirstmaserpage = app.activeDocument.masterSpreads.item(0).pages.item(0).marginPreferences.right;
            //var insidemarginsecondmaserpage = app.activeDocument.masterSpreads.item(0).pages.item(1).marginPreferences.left;
            //var outsidemarginsecondmaserpage = app.activeDocument.masterSpreads.item(0).pages.item(1).marginPreferences.right;
            var y1 = topmargin;
            var x1 = outsidemarginfirstmaserpage;
            //var x1recto = AMinsidemargin
            var y2 = pheight - bottommargin;
            var x2 = pwidth- insidemarginfirstmaserpage;           
            //var x2recto = pwidth- AMoutsidemargin;
            citpage = figCitationPage.name;
            figfm = placeIntoFrame(app.activeDocument.pages.item(citpage), [y1, x1, y2, x2]);
            figfm.fit(FitOptions.FRAME_TO_CONTENT);
            figfm.textWrapPreferences.textWrapMode = TextWrapModes.BOUNDING_BOX_TEXT_WRAP;
            figfm.textFramePreferences.ignoreWrap = true;
            figfm.appliedObjectStyle = mydoc.objectStyles.item("ofigure");
            fy1 = figfm.geometricBounds[0];
            fx1 = figfm.geometricBounds[1];
            fy2 = figfm.geometricBounds[2];
            fx2 = figfm.geometricBounds[3];
        return true;

Similar Messages

  • Help! After restoring my computer from Carbonite, My e-mails are corrupted. Each one multicorruptedplies a bajillion times! I erase them from the folder, erase them, then they come back. I have three mailbox accounts,each one does the same.

    eHelp! After restoring my computer from Carbonite, My e-mails are corrupted. Each one multiplies a bajillion times! I delete them from the folder, empty trash, them, then they come back. I have three mailbox accounts,each one does the same.

    This is the Mac App Store forum.
    For your specific issue, you'll get more feedback in the Snow Leopard forum.
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.6_snow_leopard

  • With OS X10.9 the Mail window (after hitting reply or forward) grows ridiculously long, sometimes 4 times the width of the screen and would not allow me to readjust the window size. Any one has the same problem? How shall I go about fixing it? (Thanks)

    With OS X10.9 the Mail window (after hitting reply or forward) grows ridiculously long, sometimes 4 times the width of the screen and would not allow me to readjust the window size. Any one has the same problem? How shall I go about fixing it? (Thanks)

    I'm having the same problem.  I've tried going into the Library and deleting the mail plist file(s), which fixes the problem, but only temporarily.  Would appreciate any help here too!

  • Unable to download e-books after PC upgrade.  I recently upgraded my laptop to one from the same vendor so all I had to do was to upgrade a few drivers on the hard drive.  Unfortunately my copy of ADE is not so cooperative.  Every time I try to download a

    I recently upgraded my laptop to one from the same vendor so all I had to do was to upgrade a few drivers on the hard drive.  Unfortunately my copy of ADE is not so cooperative.  Every time I try to download an e-book I get the message "E_AUTH_BAD_DEVICE_KEY_OR_PKCS12".  Uninstalling ADE (all three versions) along with cleaning the registry does not clear the error.  And I cannot de-authorize and reauthorize my new laptop as the de-authorize option is greyed out.  Anyone else encounter this issue?

    Problem solved finally.  Used regedit.
    https://helpx.adobe.com/digital-editions/kb/error-e_act_not_ready.html

  • Have synced my iPhone numerous times and some of the memos in "Voice Memos" on my iPhone wont go over to my iTunes program on my computer. I have a folder titled "Voice Memos" on my iPhone and one of the same name on iTunes on my computer.

    I have synced my iPhone numerous times and some of the memos in "Voice Memos" on my iPhone wont go over to my iTunes program on my computer. I have a folder titled "Voice Memos" on my iPhone and one of the same name on iTunes on my computer. But after I sync I only get 6 out of the 9 voice memos on my iPhone.
    How do I get the rest (or all) of the memos from my iPhone copied to my computer?
    Albro P Michell
    [email protected]

    "I have logged in to my itunes account on a different computer and none of my purchased music is showing up."
    Correct.  it does not magially appear in other places.  It will only be where you put it.
    "I also have plugged my iphone in to get updates but it says I will lose all media and apps if I don't update on the computer where  I sync everything. "
    Correct as well.  Iphone will sync with one computer at a time.  Syncing to another will erase the current content.
    You need to copy everything ( itunes library/contacts/pics/calendars/files/docs) from the old computer, or your backup copy of the old one, to the new one.

  • I am running 10.6.8 and using iweb for my web site. After several SEO analysis they all indicate I need H1-6 header tags. After looking at the source code I see there are none in iweb. Is it necessary to add? If so, how do I add H Tags to iweb.

    I am running 10.6.8 and using iweb for my web site. After several SEO analysis they all indicate I need H1-6 header tags. After looking at the source code I see there are none in iweb. Are they necessary to add?  Why would one add these tags and how do I add H Tags to iweb? And are there examples to look at? I am slowly learning about simple web design and assumed that iweb was stand alone without having to write code. Is this one of the reasons iweb is no longer supported? Thanks for looking at this!

    A simple text page like this:
    Heading
        sub heading
              text paragraph ....
    Is traditionally represented by html tags like:
    <h1>Heading</h1>
         <h2>sub heading</h2>
              <p>text paragraph ... </p>
    I would guess that the use of h1-h6 tags helps search engines to understand the structure of a page as the tags imply a certain structure.
    This can be compared to more generic tags like <div> that could represent any kind of content - and may be what iWeb uses (you'll have to check yourself).
    I would generally recommend that you use some kind of up to date blog/site building tool, perhaps Wordpress or Squarespace (I haven't used either one myself) that support current web technologies - this should reduce your SEO issues and make it easier to properly support mobile/tablet users.

  • I created my Apple ID in Ireland, but would now like to switch to a German Apple ID, keeping the same email address. How do I delete my old Irish Apple ID, so I can create a new German one with the same email?

    I created my Apple ID in Ireland, but would now like to switch to a German Apple ID, keeping the same email address. How do I delete my old Irish Apple ID, so I can create a new German one with the same email?

    Welcome to the Apple Community.
    Click on your account name in the top right corner of the iTunes store in the iTunes application on your computer, enter your password and click the "view account" button. Navigate to the Apple ID summary where you have the option to "change country or region".
    In order to change your location, you will need a credit card registered to an address in the location you are trying to change to.
    You cannot change your location if you have credit on your account, if you are unable to spend your credit and leave a balance of zero, contact Apple, which you can do through iTunes Store Support.

  • Profile manager shows only one profile but I have two profiles located in the same place and I want to change

    I have had a Firefox crash and uninstalled then reinstalled three times. For some reason Mozbackup won't back up my files. In checking profiles, I have two profiles with different names and both marked default, located in the same place. I would like to use the old profile but the profile manager only shows one profile.
    How can I get to use the old profile?
    Thanks, Joe

    Antaeus00 wrote:
    I tried sending a request for help,
    But did you succeeed in sending a request for help?
    Did you receive a response? How long has it been since you sent a request?
    but I need someone with more authority to talk to.
    There is no one with more authority than iTunes store support. We herem are only users.

  • My i phone got stolen and i got a new one with the same number but how do i synch it up with my old contacts?  i thought i could do from ituned but it hasnt worked!!

    hello,
    my i phone got stolen and i got a new one with the same number, but i cant get it to synch up with my itunes to make it like my old phone! can you please tell me how i do this. i need all my contacts and content etc etc.

    Plug it into iTunes and tell iTunes what to sync to the device.

  • Admin and Task servers as one in the same

    I open up the Remote Desktop software, and select 1 computer from the list. I then click on the "Install" icon and drag a .pkg file inside of the "Packages" area. I check off the radio button that says "Run this task from: The Task Server on this computer" and click the "Install" button.
    I get a progress bar that runs infinitley and a message that says "The targetd computer, "<computer name>", is currently idle. It doesn't matter if the computer is up and running, or if it is offline. It says the same thing regardless and never installs the package.
    If I decide not to "Run this task from: The Task Server on this computer" and instead "Run this task from: This application" then it works prefectly. I just can't seem to install from the local task server, which means I have to wait until this machine is online before I can manually run it, which means there's a problem with the way I set up the Task server.
    Does anyone have any idea what's wrong with my installation? I have gone into "Remote Desktop -> Preferences -> Task Server" and made sure "Use Task Server on this computer" was selected, and it is. I am NOT using 2 different serial number for 2 different and separate copies of ARD3 for both an Admin + Task Server. I am, however, expecting the Task Server and Admin Server to run as one in the same. If this is not possible then perhaps the Documentation needs updating? From http://images.apple.com/server/docs/ARDTaskServer.pdf I read: "You can run the Task Server on either the administrator computer or a dedicated remote computer. The default Task Server is the administrator computer on which you installed Remote Desktop.". This means the Admin and Task Servers can run as one in the same, no? Please let me know if this is incorrect.

    Update: Please refer to the post with the title of "Possible to run both an Admin Server and Task server from the same host?". Basically the answer to this problem is that there isn't one. I've called apple support and it's been confirmed that an Admin server and Task server CANNOT be run from the same installation on the same host. I suppose you could say the answer is to buy another license of ARD3 and run it in a separate host, but for some of us this isn't an option - especially for a very small startup.

  • I have an iPad 4th Gen with Retina Display.  I want to watch movies on an airplane.  I downloaded downloaded one movie successfully from digital copy, but my next movie only plays when I am connected to wifi, and the other one is the same way now

    I have an iPad 4th Gen with Retina Display.  I want to watch movies on an airplane.  I downloaded downloaded one movie successfully from digital copy, but my next movie only plays when I am connected to wifi, and the other one is the same way now

    Hi there slogrown,
    You may need to download these purchases directly to the device. Take a looke at article below for more information.
    Downloading past purchases from the iTunes Store, App Store, and iBooks Storehttp://support.apple.com/kb/HT2519
    -Griff W.

  • HT1918 My Apple ID (email address) is somehow registered to the US store even though I live in the UK. Can I close the US account and open a UK one with the same ID/email?

    My Apple ID (email address) is somehow registered to the US store even though I live in the UK. Is there any way I can close the US account and open a UK one with the same ID/email?

    No, but you can change the country of your iTunes Store account. Sign into your iTunes Store account and click the "change country" link. You'll need a valid UK credit card to complete the change. If you have any credit balance remaining, you'll need to contact the iTunes Store to clear that for you before you'll be able to change the country.
    Note that if you purchased anything from the US iTunes Store, you probably will not be able to re-download it nor update apps once you change the country. So you may prefer to set up a new email address so you can create a new account in the UK iTunes Store. You can change the email address to which receipts and other notices are sent to your actual email address, if you prefer.
    Regards.

  • My iPad 4 says not charging but it does slowly charge . I got it replaced on sat but the new one is the same . I have tried using a different power outlet and it is the same so it appears to be an issue with the new iPad

    Can anyone help .my new iPad notes not charging when it is in fact slowly charging.  I had it replaced 2 days ago but the new one has the same issue.it would appear this is a common issue with ipad4.can anyone advise on how to get over this problem. .thanks

    Found this thread by searching the forum. I hope it helps.
    https://discussions.apple.com/thread/5471311

  • I can't make my Apple ID and my primary email one and the same. I've had my Apple ID since the first iPod but now I can't access iCloud because of this.

    Since the introduction of iCloud, I've had this problem with the Apple ID. I've tried to "manage my Apple ID" but clicking the box to "make Apple ID and primary email address one and the same" but it just won't work. I'd given up and just ignored everything iCloud... I've ignored iCloud on my iPad mini and my iPhone 5 and now I'm going to get an iPhone 5s. I'm sure this will be an issue again. FYI, my Apple ID is in the format "a_xyz" only and it's working for purchases and upgrading of iOS, etc just not with iCloud. Any suggestions other than to create a new iCloud account with a different name? Thanks!

    I don't have any suggestions that will help you resolve this issue other than to try posting here where there should be more iCloud experts.
    https://discussions.apple.com/community/icloud/icloud_on_my_ios_device
    Or contact Apple and ask for their help with this. Try here. I think Account and Setup would be the starting point.
    https://getsupport.apple.com/Issues.action

  • I forgot my digital signature password. How do I create a new one with the same email.

    I can not remember my digital signature password. I've attempted to create a new one with the same email address. The message I receive is that i already have a digital signature with that email. I would like to use the same email address.

    You probably mean that you forgot your digital certificate password and I presume that this is a self-signed certificate that you yourself created, not a certificate that you received from a Certificate Authority (CA). If this is true then you can create a new self-signed digital certificate (Digital ID in Acrobat-speak) the same way you created the first one: In Acrobat XI it is Edit->Preferences->Signatures->Identities&Trusted Certificates->More. Then click on "Add ID" button and follow the prompts. You can create as many self-signed certificates with the same credentials (name, email, etc.) as you wish. You'd have to figure out how to distinguish them, though.

Maybe you are looking for