Indesign Scripting: How can I move a placed item using Javascript?

Hey all,
I have been trying to write a script that places a slug object from an indesign library on to a document and then moves it to my slug area. It all seems to work except the move command. I think the problem is that I haven't selected my placed asset correctly.
Please help!
This is what I have so far:
//Create new document
var doc = app.documents.add();
// Get page size values
var w = doc.documentPreferences.pageWidth;
var h = doc.documentPreferences.pageHeight;
//Create layer called SLUG
var slugLayer = doc.layers.add({name:"SLUG"});
//Set document slug area size
doc.documentPreferences.documentSlugUniformSize = false;
doc.documentPreferences.slugBottomOffset = "20 mm";
//Open InDesign library file that contains the slug file
var slugLibrary = app.open(File("/Users/Shared/Slug.indl"));
//Place slug script to go here
var myPlacedAsset = slugLibrary.assets.item("Slug");
var mySlug = myPlacedAsset.placeAsset(doc);
//Close the slug library
slugLibrary.close();
// Move slug object to slug area
mySlug.move([0,0]);
//Lock SLUG layer
slugLayer.locked = true;

placeAsset is an array so this line :  mySlug.move([0,0]);
should be changed to: mySlug[0].move([0,0]);

Similar Messages

  • How can I hide figures or characts. using javascript in wad report BI NW 7

    Hi,
    How can I hide figures or characteristics using javascript or command in wad report ( BI NW 7).
    I have read the documentation for WEB API, but it doesn't provide some info on that area.
    Thank you.
    Edited by: Sergey Antonov on Jul 29, 2011 3:08 PM

    You can use REMOVE_DRILL_DOWN in WAD to remove characteristic..to remove a keyfigure with a button you could a variable with that button, which makes an invalid selection of the keyfigure though it is 2000, e.g. set CALYEAR = 1900.
    Hope it helps,
    Christian

  • How to validate an text field item using javascript for numbers only.

    hi,
    how to validate an text field item using javascript for numbers only.please help me on this urgent
    please mail me solun if posible on [email protected]

    Hi,
    Page HTML header
    <script>
    function onlyNum(evt) {
      // Usage: onKeyPress="return onlyNum(event)"
      evt = (evt) ? evt : window.event;
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        var status = 'This field accepts numbers only!';
        alert(status);
        return false;
      var status = '';
      return true;
    </script>Item HTML Form Element Attributes
    onKeyPress="return onlyNum(event)"Br,Jari

  • How can I call a web service using JAVAscript in LCD

    hi guys,
         I know it can call a WSDL in LCD, but I have not any WSDL web service , and I have a REST web service ,how can I call this REST web service in LCD? I checked some documents and found nothing...if it's possible that it can call a REST web service using JAVAScript code, I mean I can program some code to call this web service ?
    thanks,
    Jesse

    Hi Jesse,
    You can do GET, PUT and POST using FormCalc, so you should be able to access a REST web service. 
    There is a example of accessing a RSS feed in this thread, http://forums.adobe.com/message/5695433#5695433
    Regards
    Bruce

  • How can I move photos from other albums into the camera roll

    I have synced photos from my computer onto the iPad. There placed in a different album. How can I move them into the camera roll?

    You could do it by setting up a Shared Photo Stream. Select the photos in the Photo app then tap the Shared button selecting Photo Stream. Just don't enter any email address and it will appear on your other devices. Only photos can be added and not albums so you will have to re-organize then on the iPhone.
    I would recommend getting the photos to the computer as well though. Create a photo library on the computer and sync then over to the iphone with iTunes. The photo library on the computer can be added to a more reliable backup.

  • Animation: how can I move objects (and their transform keyframes)?

    Hi,
    I have created a project with a group of layers which all move (have transform keyframes set up).
    Now I want to move the group, but when I do this and then run the animation, the position of all the transform keyframes I have set up remain in the same place.
    Is there some way to move a group of objects and the location of their transform keyframes at the same time, or will I have to go through each keyframe and move them individually?
    Thanks!
    Jack

    > PLEASEEE HELPP
    You need to get some understanding of HTML and CSS to know
    why building a
    web page is not like using a page layout program or even a
    word processor.
    Unfortunately that will require some effort on your part.
    You cannot just place things on the page in HTML - you need
    to build an HTML
    infrastructure to hold the elements you want to appear on the
    page, and to
    hold them in the location where you want them to appear. As a
    simple
    example, consider a 1 row by 2 column table, where each
    column is set to 50%
    width, and the table itself is 800px wide. An image placed
    into the second
    column will be located exactly 400px from the left margin of
    the page
    (assuming a) the image is less than 400px wide, b) the table
    has zero
    borders, cellspacing and cellpadding, and c) there is nothing
    wider than
    400px in the first column.
    Make sense?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "afsheenm" <[email protected]> wrote in
    message
    news:fftbo8$cok$[email protected]..
    > hi, its my first time making the website so i have no
    clue about anything.
    > how
    > can i move text box? i mean i wrote something and want
    to move its
    > position
    > like up or down, how can i move it? also tables??????
    sometimes i can move
    > them
    > , by chance but i have no clue how i did it? PLEASEEE
    HELPP.
    >

  • How can i move objects?

    hi, its my first time making the website so i have no clue
    about anything. how can i move text box? i mean i wrote something
    and want to move its position like up or down, how can i move it?
    also tables?????? sometimes i can move them , by chance but i have
    no clue how i did it? PLEASEEE HELPP.

    > PLEASEEE HELPP
    You need to get some understanding of HTML and CSS to know
    why building a
    web page is not like using a page layout program or even a
    word processor.
    Unfortunately that will require some effort on your part.
    You cannot just place things on the page in HTML - you need
    to build an HTML
    infrastructure to hold the elements you want to appear on the
    page, and to
    hold them in the location where you want them to appear. As a
    simple
    example, consider a 1 row by 2 column table, where each
    column is set to 50%
    width, and the table itself is 800px wide. An image placed
    into the second
    column will be located exactly 400px from the left margin of
    the page
    (assuming a) the image is less than 400px wide, b) the table
    has zero
    borders, cellspacing and cellpadding, and c) there is nothing
    wider than
    400px in the first column.
    Make sense?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "afsheenm" <[email protected]> wrote in
    message
    news:fftbo8$cok$[email protected]..
    > hi, its my first time making the website so i have no
    clue about anything.
    > how
    > can i move text box? i mean i wrote something and want
    to move its
    > position
    > like up or down, how can i move it? also tables??????
    sometimes i can move
    > them
    > , by chance but i have no clue how i did it? PLEASEEE
    HELPP.
    >

  • How can I move apps from one computer to the other?

    How can I move apps from one computer to the other?
    (preferably without iCloud)

    Backup your iTunes library to an external drive and onto the other computer
    http://support.apple.com/kb/ht1751

  • Home computer crashed.  How can I move stuff from iPod Touch to a new computer?

    Our home computer crashed.  How can I move stuff from iPod touch to a new computer?

    - Transfer iTunes purchased by:
    iTunes Store: Transferring purchases from your iPhone, iPad, or iPod to a computer
    - Transfer other stuff via the third-party programs discusses in this prevous discussion:
    Best iPod to PC

  • How can I move photos from my computer to a Thumb drive?

    How can I move photos from my computer to a Thumb drive?

    https://discussions.apple.com/message/16881894#16881894
    2 way to get the icon...
    Finder>Preferences>General, check what you want to show on Desktop.
    Finder>Preferences>Sidebar, check what you want to show in the Sidebar of all windows.

  • How can I move contact from one group to another?

    HOW CAN I MOVE A CONTACT FROM ONE GROUP TO ANOTHER GROUP?

    You usually make ​​contact groups via a computer (Mac or PC). If you use a mac and sync. via iCloud, you can go into Contacs.app and organize your contacts as you wish. Then (if) you sync with iCloud the groups you've changed or created will be displayed on your iPhone and (or) iPad.
    Hope this helped you.

  • How can I move bookmarks from one computer to another.  JUST BOOKMARKS, NOT ANYTHING ELSE

    How can I move Bookmarks from my MacBook Pro to my iMac; just Bookmarks, nothing else.

    Safari Bookmarks?
    Export bookmarks as a HTML file to a usb stick or something.
    Put the USB in your other computer and import bookmarks 

  • How can I move the ODI Work Repository from one server to another server?

    How can I move the ODI Work Repository from one server to another server?

    Hi,
    If you would like to move your source models, target models and project contents from Work repository 1 to another work repository.
    I.e. Dev. server to Prod Server.
    1. Firstly, replicate the master repository connections i.e. with same naming conventions manually
    2. Go to Dev. Server work repository -> File Tab -> Click on Export work repository (save it in a folder)
    3. After exporting, you can view the xml files in the folders.
    4. Now, Open the Prod. server and make sure you already replicated mas. rep. details.
    5. Now, right click on model and import source model in synonym mode insert_update (select source model from the folder where your xml file located)
    6. Similarily, import again target then Project.
    Now, check. It should work.
    Thank you.

  • How can I move my e mails from another provider on my I pad to icloud storage

    I Have 15,000 e mails I have that I need to keep but would like to move them to the cloud how can I move them from my e mail account to the cloud they are using up 10gig of storage on my I pad and would rather use the icloud storage rather then the hard drive. It won't let me update the operating system due to the hard drive being too full. Please help

    Use migration assistant, email it to the other computer or transfer the file using iChat.

  • How can I move an icon/file from one screen of my ipad to another?

    How can I move an icon/file from one screen on my ipad to another?

    Press and hold the icon until they start to wiggle. Then while holding it, drag it to the edge of the screen and wait for the page to switch, then let go of the app

Maybe you are looking for

  • Report Designer drill down issue

    Hi Friends, I am having an issue with report designer.When i run the report designer the characteristics are getting displayed in drill down form for each row of values.Is there any way to restrict this. i want to display the header part in tabular v

  • Sometimes firefox opens a blank page, just a frame and nothing else

    This is on a brand new laptop, I just installed firefox 25, I have not installed any add-ins yet nor have I installed any software except windows updates, and just activated the Symantec trial. (this issue happens on my old system as well which has A

  • Need help ASAP: No video card signal for neo4 plat

    I just bought a new case, motherboard, ram, video card, power supply, and CPU. i took my drives from my old Dell and placed them into this case and the MSI neo4 plat. motherboard (specs at the bottom). after getting it to post, i noticed there was no

  • Not showing tables today...again.

    im using the dreamweaver toolbox and cs3 and i can only sporadically find my tables. it frustrated the hell out me but now its just not working at all. i can upload and download form my server but i can never access my tables "no tables found" i thin

  • I have received my serial number for CS6 but can't find any link to download the software...

    I can't find any links to actually download CS6 Design and Web. Could someone please help!!! I have my serial number so just need to download the software. I've been on the phone to Adobe for over an hour and a half now on hold...not having much luck