How can I add a library asset to a specific master spread?

Hello! I am new to the forums and rather new to javascript as it relates to indesign so I apologize if this is rudimentary.
I am building a script that automates new document creation for our company and have run into a problem with placing library assets.
I want to add a library asset to a specific master page by name, but I cannot find a way to do this.
I can get assets to place into my document with this:
            var t = app.libraries.item(0);
            var libTapeStrip= t.assets.itemByName('Tape Strip');
            var myTapeStrip = libTapeStrip.placeAsset(myDocument);
However, the asset is being placed on a master spread that I had previously added to the document. It seems to be the active or front most spread because when the script is complete and I create a new window that spread is what is displayed with the asset on it.
I would like to place the asset on another master spread, but placeAsset() only accepts documents and text boxes. I have also looked on a way to bring the master spread I want to the front, but cannot find this either.
If anyone can lead me in the right direction I would appreciate it!!
Thanks,
Ben

@Benjamin – You could make the spread (or the page) where you want to place that asset the "activeSpread" or "activePage", place the asset and then go back to the old active one.
Something like this:
(Here I assume that you want to place your asset on a master spread named "A-Master" and the asset is the first in the one and only library file that is open.)
var myDocument = app.documents[0];
var myMaster = app.documents[0].masterSpreads.itemByName("A-Master");
var myLibrary = app.libraries[0];
var myAsset = myLibrary.assets[0];
var myOLDActiveSpread = myDocument.windows[0].activeSpread;
myDocument.windows[0].activeSpread = myMaster;
myAsset.placeAsset(myDocument);
myDocument.windows[0].activeSpread = myOLDActiveSpread;
Uwe
Message was edited by: Laubender
Message was edited by: Laubender [Nothing edited in the code.]

Similar Messages

  • How can I add a library of flash movies to my site?

    I posted this same question on the Dreamweaver forum and a suggestion was made that I try over here for help, so please excuse the duplicate question.
    How can I add a library of flash movies to my site?
    Hey there everyone and thanks for reading my question.
    I have a library of flash movies (specifically a library of maps) and when the map movies are run in Flash they call each other just fine (i.e. the USA map will load the Georgia map when Georgia is clicked on the USA map, etc etc etc for each state).
    HOWEVER, when I insert the USA map in one of my site pages (I'm working on the site using Dreamweaver CS4) the USA map page will load, but when a state is clicked the area on the page for the map goes blank and the state map does not load.
    Short of coding a specific path in each of my state maps (in the Flash editor) is there a way to tell Dreamweaver there is a library of maps, look there for the sub-map?
    and if I do have to code the path to the map, can I code a relative path rather than a specific URL address for the maps?
    I know this is probably one of those simple things, but I'm not seeing it (can you tell I'm new at this??)
    Thanks in advance for any help!
    Frances

    Hey again,
    Thanks for the helpful suggestions. Everyone's comments got me to thinking about what the path was in the calls from the maps.
    here is what finally worked:
    on (release)
    loadMovie("../FlashIMapDownloads/georgia.swf", 0);  
    this script code is in the action script for the "georgia" button of my main map - a US Map. (I hope I'm describing all this correctly).
    I'll post this same info in the Dreamweaver forum too.
    Thanks again!
    Frances

  • How can I "add to library" other people's music

    I recently had some random person pop up in my itunes menu. I tried to select some songs and "add to library" some of his music, but it didn't do anything. Also, how do share random people's libraries like that? Thanks

    You can't. Copying from another person's computer would in most cases be a copyright violation (and definitely when it's someone you don't know) , so it's not possible in iTunes.
    As to why you're seeing those libraries, you're seeing the shared iTunes library from some other computer on your local network. If you don't want to see them any more, go into the iTunes Sharing preference and turn off "look for shared music". If you don't want to similarly be sharing your iTunes library with other computers, make sure that the "Share My Music" option is unchecked.

  • How can i add a library path for a .dll library?

    hi
    i used a native method (sndPlaySound) in a dll file (winmm.dll).
    then i complided my source successfuly , but in runtime i recieve
    this Exception :
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no winmm.dll in java.
    library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1312)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at JNItest.<clinit>(JNItest.java:9)
    i know i must add the library path to the java.library.path but
    i don't find "java.library.path" and don't know what i must to do.
    i am in windows 98 and don't use any IDE (just jdk 1.3.1).
    thank you very much.

    Windows uses the current PATH enviroment variable to search for dlls.
    Windows searches for dlls in the Current directory , the application directory (if the current is not the same) , the PATH variable, then the system directories (Windows, Windows/system)
    It's different in every OS, but if you only care about windows...
    Also try searching on msdn.microsoft.com, they might have more information there.

  • How can I add value to asset without extending life?  Help!

    My team and I are working on a new straight-line depreciation key.  During testing we've found that if we add value to an asset in the year after acquisition, there is a depreciation adjustment in the month after the asset becomes fully depreciated.  We can't have this happen becuase it has already been identified as a Sarbanes-Oxley remediation item.  How do we eliminate this adjustment after the asset becomes fully depreciated?

    Thank you so much for your response Bernhard!  Forgive me if I sound obtuse, I am an accountant and not a techincal expert.  What you described sounds like the method we are moving away from.  The method calculates based on remaining value over remaining life, but we've seen huge adjustments made at the end of the placed-in-service year, followed by a sharp decrease in depreciation amounts in subsequent years.  This is not acceptable because our corporate policy requires straight-line depreciation.
    If I am not interpreting your response correctly, please let me know.
    I'm wondering if "smoothing" would eliminate the adjustment in the period after the asset fully depreciates. Your thoughts on this are welcome!
    Regards,
    Laurie

  • How can i add a library on an ipa file ?

    the solution from www.mocana.com  allows for maximum user flexibility and native experience, while not risking corporate intellectual property.
    * Increase productivity by fully supporting bring your own device (BYOD)
    * Embrace Bring Your Own Device (BYOD) without additional IT burden or privacy issues
    * Use best-in-class, military-grade security methods by a company known for its security legacy
    * Highest level of security protecting corporate data
    * No programmatic effort to secure the apps -  MAP is automated and can take prior written apps and secure them in under 5 seconds
    can someone tell me how this works?

    it works ... but i don't know how ... example :
    the solution from www.mocana.com  allows for maximum user flexibility and native experience, while not risking corporate intellectual property.
    * Increase productivity by fully supporting bring your own device (BYOD)
    * Embrace Bring Your Own Device (BYOD) without additional IT burden or privacy issues
    * Use best-in-class, military-grade security methods by a company known for its security legacy
    * Highest level of security protecting corporate data
    * No programmatic effort to secure the apps -  MAP is automated and can take prior written apps and secure them in under 5 seconds
    i hope someone can tell me how....

  • How can i add my itunes library to my iphone?

    how can I add my itunes library to my iphone. when i sync no music is added?

    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf

  • HT4059 how can i add books to the library on my iphone 4s

    How can I add books to the library on my 4s?

    If the photos that you are wanting to delete are also in your Camera Roll then you can delete them from the camera roll

  • How can I add my own files to the TV Shows Library instead of the Movie Library?

    I have my own TV Shows in m4v format.  I can drag and drop the TV Shows into the iTunes Movie Library.  How can I add my files to the TV Shows Library?  Can I group them by show in the TV Shows Library?

    Select the files in iTunes.
    Right click - get info.
    Select the Options tab and set Media kind to TV Show.
    Better yet, use something like MetaZ to tag the files before adding them to iTunes.
    -> http://www.macupdate.com/app/mac/36029/metaz

  • My computer where my itunes library is stored is no longer accessible.  how can i add songs to my ipod nano without losing the songs already on it.

    The computer where i have my itunes library is no longer accessible.  How can I add new songs to my  Ipod nano without losing the song already on it?

    You will need that library copied from the old computer. If not, then you can take a look at this in getting 3rd party software to recover your library from the iPod. Syncing to a "New" Computer or replacing a "crashed" Hard Drive

  • After creating a new playlist in iTunes, how can I add my entire music library --at once-- to the new playlist. I want to download all my music from Icloud at once on my Macpro

    After creating a new playlist in iTunes, how can I add my entire music library --at once-- to the new playlist. I want to download all my music from Icloud at once on my Macpro

    You have two separate questions here...
    To get all your music into one playlist, select Music in the sidebar and click the Songs view at the top. Then, highlight all the songs and drag them into your playlist.
    I don't know if it's possible to download all Purchased content (or do you mean iTunes Match content?) at once; try a few Google searches.

  • How can I add a folder of music to my library?

    How can I add a folder of music to my library?

    I am mystified as to what drag and drop folder into iTunes 11 means.  My music is in a folder in "My Documents"/Windows 7. I can copy and paste the individual folders of music within the back up folder, and drop them into the music folder in iTunes.  But, this is ridiculous.  It was easy and promoted user enjoyment to have the ability to add folders from wherever on your computer, into the iTunes library. Why did Apple reduce the users enjoyment, by flubbing up a pretty good music file system?
    Work around?

  • A friend mailed me a flash drive with music on it from his pc...  mostly wma files.  How can I add these to my itunes library?

    My friend created a BIG music file on his pc then saved it to a flash drive.  It is mostly wma files..  how can I add this to itunes library?

    Install Flip4Mac's WM Components (from their download page), required to play WMA in QuickTime, the Finder's preview column, and many other applications -- but not iTunes!
    Open your WMA file in QuickTime Player (Pro version required), then save as reference movie.
    Drag the newly created .mov file onto iTunes. Now you can play it as you would any other song.
    Some metadata is copied to the QuickTime file, and you can edit/add tags in iTunes. Remember to keep the original WMA files in place, as your reference .mov files still point to them. If you don't mind one more conversion step, you can then liberate your WMAs within iTunes. Select your WMA songs in iTunes, go to the Advanced Menu, click Convert selection to MP3/AAC, then enjoy your music on the iPod.

  • HT4527 How can i add my backup itunes to my itunes library?

    How can i add my backup itunes to my itunes library? I backed up a friends ipod touch whose backup itunes is stored in my computer...however i'd like to add his backup itunes into my library so i can play the music from his backedup itunes? how can i do this?

    What is "backup itunes"? 
    iDevice backups do not contain media, never have, never will.

  • How can I add music to my itunes library from my other ipods?

    How can I add music to my itunes library from my other ipods?

    The sync is one way - computer to ipod.  The exception is itunes purchases:  File>Devices>Transfer Purchases

Maybe you are looking for