Paste in place to next Master unfunction, can you fix it?

Hi, everyone
I got this script, which copy from:
Paste In Place to Specify Master Page
I change it into:
var myDialog = app.dialogs.add({name:"Copy Select item to next Master",canCancel:true});
with(myDialog){
    with(dialogColumns.add()){
    staticTexts.add({staticLabel:"Select a Master you want to copy to"});
        with(dialogRows.add()){
           var mySelection = dropdowns.add({stringList:["Master A", "Master B","Master C", "Master D", "Master E","Master F", "Master G"], selectedIndex:0});
if (myDialog.show() == true)
function main(){
  if("Copy to next Master");
      copy_to_next_master(); 
function copy_to_next_master() { 
    if (mySelection.selectedIndex == 0){
var nSel = app.selection.length;   
for ( var i = 1; i < app.documents.length; i++) {   
        var nextDoc = app.documents[i];   
        if (!nSel) { alert( "Nothing selected!" ); exit(); } 
        for ( var n = 0; n < nSel; n++ ) { 
            var curSel = app.selection[n]; 
            curSel.duplicate( nextDoc.masterSpreads[0] ); 
alert("Done.\rWhat you select are pasted in place to next documents' Master  A");
    if (mySelection.selectedIndex == 1){
var nSel = app.selection.length;   
for ( var i = 1; i < app.documents.length; i++) {   
        var nextDoc = app.documents[i];   
        if (!nSel) { alert( "Nothing selected!" ); exit(); } 
        for ( var n = 0; n < nSel; n++ ) { 
            var curSel = app.selection[n]; 
            curSel.duplicate( nextDoc.masterSpreads[1] ); 
alert("Done.\rWhat you select are pasted in place to next documents' Master  B");
    if (mySelection.selectedIndex == 1){
var nSel = app.selection.length;   
for ( var i = 1; i < app.documents.length; i++) {   
        var nextDoc = app.documents[i];   
        if (!nSel) { alert( "Nothing selected!" ); exit(); } 
        for ( var n = 0; n < nSel; n++ ) { 
            var curSel = app.selection[n]; 
            curSel.duplicate( nextDoc.masterSpreads[2] ); 
alert("Done.\rWhat you select are pasted in place to next documents' Master  C");
    if (mySelection.selectedIndex == 1){
var nSel = app.selection.length;   
for ( var i = 1; i < app.documents.length; i++) {   
        var nextDoc = app.documents[i];   
        if (!nSel) { alert( "Nothing selected!" ); exit(); } 
        for ( var n = 0; n < nSel; n++ ) { 
            var curSel = app.selection[n]; 
            curSel.duplicate( nextDoc.masterSpreads[3] ); 
alert("Done.\rWhat you select are pasted in place to next documents' Master  D");
    if (mySelection.selectedIndex == 1){
var nSel = app.selection.length;   
for ( var i = 1; i < app.documents.length; i++) {   
        var nextDoc = app.documents[i];   
        if (!nSel) { alert( "Nothing selected!" ); exit(); } 
        for ( var n = 0; n < nSel; n++ ) { 
            var curSel = app.selection[n]; 
            curSel.duplicate( nextDoc.masterSpreads[4] ); 
alert("Done.\rWhat you select are pasted in place to next documents' Master  E");
    if (mySelection.selectedIndex == 1){
var nSel = app.selection.length;   
for ( var i = 1; i < app.documents.length; i++) {   
        var nextDoc = app.documents[i];   
        if (!nSel) { alert( "Nothing selected!" ); exit(); } 
        for ( var n = 0; n < nSel; n++ ) { 
            var curSel = app.selection[n]; 
            curSel.duplicate( nextDoc.masterSpreads[5] ); 
alert("Done.\rWhat you select are pasted in place to next documents' Master  F");
    if (mySelection.selectedIndex == 1){
var nSel = app.selection.length;   
for ( var i = 1; i < app.documents.length; i++) {   
        var nextDoc = app.documents[i];   
        if (!nSel) { alert( "Nothing selected!" ); exit(); } 
        for ( var n = 0; n < nSel; n++ ) { 
            var curSel = app.selection[n]; 
            curSel.duplicate( nextDoc.masterSpreads[6] ); 
alert("Done.\rWhat you select are pasted in place to next documents' Master G");
but unfunction, can you fix it?
thanks
Teetan

Hi,
Modifying your code - notice that function main() suppose to be
1. defined and
2. called
Compare it to this code:
#target  indesign
var
  myDialog = app.dialogs.add({name:"Copy Selected item(s) to chosen Master",canCancel:true}),
  mStringList = ["Master A", "Master B","Master C", "Master D", "Master E","Master F", "Master G"];
with(myDialog){
  with(dialogColumns.add()){
  staticTexts.add({staticLabel:"Select a Master you want to copy to"});
  with(dialogRows.add()){
  var mySelection = dropdowns.add({stringList:mStringList, selectedIndex:0});
main();
function main(){
  if (!app.documents.length || !app.selection.length)
  alert( "Nothing selected!" );
  exit();
  if (myDialog.show() == true)
  copy_to_next_master();
function copy_to_next_master() {
var
  mChoice = mySelection.selectedIndex,
  mMsg = "Done.\rWhat you select is pasted in place to next documents - " + mStringList[mChoice],
  nSel = app.selection.length,
  mDone = false,
  i,n,nextDoc,curSel;  
for ( i = 1; i < app.documents.length; i++) {  
  nextDoc = app.documents[i];  
  targetMaster = nextDoc.masterSpreads[mChoice];
  if (!targetMaster.isValid) {
  mMsg += "\rCan't detect " + mStringList[mChoice] + " in a doc: " + nextDoc.name;
  continue;
  mDone = true;
  for ( n = 0; n < nSel; n++ ) {
  curSel = app.selection[n];
  curSel.duplicate( nextDoc.masterSpreads[mChoice] );
mDone ? alert(mMsg) : alert("Nothing copied");
Jarek

Similar Messages

  • I purchased a season of a TV show from itunes and it won't go onto my ipad, i've purchased several seasons in the past and never had this issue, how can i fix this?

    I purchased a season of a TV show from itunes and it won't go onto my ipad, i've purchased several seasons in the past and never had this issue, how can i fix this?

    Drew how is that even possible? I use gift cards all the time, any time I've had insufficient funds iTunes will not allow the purchase, sights Insufficient funds and rejects the purchase. Any time I log into my account the money in that account appears in the upper left corner. If you're not seeing that then you have other issues. Anyway... Kneil is right you should be able to rip CDs you own to your iTunes library (regardless of your money matters with iTunes), then depending on how you set up the music you need to add it to your playlist and then sync it to your iPod. Did imported music ever work? How are you ripping or importing the music to iTunes? Are you using a compatible format?
    Something else to look at-- It's possible your cable is defective, have you tried a new or different cable? Some of what your describing is a bad cable issue. Good luck, Cheers.

  • I attempted to download a song. It originally did not download correctly. I refreshed the download and it supposedly completed. Upon playing the song in both my library and on the Itunes store it will not play past the first 5 seconds. How can I fix this?

    It originally did not download correctly. I refreshed the download and it supposedly completed. Upon playing the song in both my library and on the Itunes store it will not play past the first 5 seconds. How can I fix this?

    Hello Whitney262,
    Thanks for using Apple Support Communities.
    I would go ahead and make sure you can first download the content, then remove the song from your iTunes Library, and download again from your iTunes past purchases.  The article below will walk you through the entire process:
    Download past purchases
    http://support.apple.com/kb/ht2519
    Take care,
    Alex H.

  • I have an 2007 mac book pro that does not have a place for HDMI cable.  Can you please tell which converter I need?

    I have an 2007 mac book pro that does not have a place for HDMI cable.  Can you please tell which converter I need?

    You will need something such as this:
    http://www.amazon.com/A-Sonic-HDMI-HD15-Male-Cable/dp/B001OLCHJ6
    Ciao.
    Note that this will only transmit video.  If you need sound, the audio output port will have to be tapped.
    Message was edited by: OGELTHORPE

  • I can't get my phone to plant a song it just skips to the next one, how can i fix this?

    i can’t get my phone to plant a song it just skips to the next one, how can i fix this?

    Hey Mclovinz,
    I found the following article that goes over what you can do if your iPod skips while playing a song:
    Troubleshooting songs that skip
    http://support.apple.com/kb/ts3217
    Have a good one,
    David

  • Can you fix this script problem?

    Hi everyone
    I got this script
    for gen underline text to pdf
    the problem is it gen each page multi times if the page more then one place has underline text
    Can you fix it?
    //======================================================================
    var f = new Folder("~/Desktop/Revised_PDF put in here/"); 
    f.create();
    var doc = app.documents; 
    app.findTextPreferences = null; 
    app.findTextPreferences.underline = true; 
    for(var i=0;i<doc.length;i++) 
            var found = doc[i].findText(); 
            var _pages = []; 
            for(var j=0;j<found.length;j++) 
                    var txfms = found[j].texts[0].parentTextFrames; 
                    for(var k=0;k<txfms.length;k++) 
                            _pages.push(txfms[k].parentPage.name); 
            for(var j=0;j<_pages.length;j++) 
                    if(_pages[j] === _pages[j-1]) 
                            _pages.splice(j,1); 
            if(_pages.length != 0) 
                    app.pdfExportPreferences.pageRange = _pages.toString(); 
                    doc[i].exportFile(ExportFormat.PDF_TYPE, new File("~/Desktop/Revised_PDF put in here/" + doc[i].name.replace(/\.indd$/i,".pdf")), false);
            _pages = []; 
    app.findTextPreferences = null;
    alert("Done.");
    var f = Folder("~/Desktop/Revised_PDF put in here/" ); 
    f.execute(); 
    //======================================================================
    for specific details:
    Is that possible to write a script for export underline text to PDF?
    thanks
    Harvey

    > the problem is it gen each page multi times if the page more then one place has underline text
    Is this only when you have multiple unconnected text frames (each one containing underlined text) on the same page? Or possibly footnotes, tables, or anchored text?
    Chinna's script assumes all text is in a single threaded story: the findText command searchs one story at a time, from start to end (and across multiple pages). If it reaches the end of the story, it continues with the next one, even if it has to go back to the first page. And anchored objects, text in tables, and text in footnotes all count as "separate texts".
    Chinna's script already removes multiple pages:
    for(var j=0;j<_pages.length;j++)
      if(_pages[j] === _pages[j-1])
        _pages.splice(j,1);
    but it only works for a continuous story, because the "found" occurrences will be in the original page order, such as "1,2,2,3,5,5". This code removes successive doubles (see the Javascript documentation for a description of "splice"). As soon as you have separate stories (tables, 'notes, et cetera), you get a series such as "1,3,3,5,1,6" -- where "1,6" would be the occurrences in a separate story.
    The solution is simple: before removing the duplicates, sort the pages. As far as scripting goes, this is remarkably easy:
    _pages.sort();
    Please note that I just felt like answering your question this once. If you do what you did on most some of your other questions (ask for multiple versions for other formatting, have a different functionality, work on "selected documents" or "all in a folder" or "in a book file", or follow up with questions about totally unrelated scripts) I will probably not answer anymore.
    No offense meant, of course.

  • I have no audio what so ever i have seen in one of the tables where it was deleted how can you fix this i tried everything i know

    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    i have been trying to get the audio to play for 3 days now i did see where it had been deleted this is a used comp i haven't had it long can you fix this i'm at my wits end
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows NT 5.0
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
    == Plugins installed
    ==
    *-Default Plug-in
    *Adobe Acrobat Plug-In Version 5.10 for Netscape
    *Java(TM) Platform SE binary
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    *Network Object Plugin
    *Windows Multimedia Services DRM Store Plug-In
    *Npdsplay dll

    Hello Virginia.
    You may be having a problem with some extension or plugin that is hindering your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal?

  • My iPod speaker is broken, i bought it one year ago, can you fix that for free?

    my iPod speaker is broken, i bought it one year ago, can you fix that for free?

    You are not address ing Apple here, we are all just users like yourself.
    If the headphones work but not the speaker:
    - Try cleaning out/blowing out the headphone jack. Try inserting/removing the plug a dozen times or so. There is a little switch in the headphone jack that disconnects the speaker when the headphone jack is inserted.
    Try the following to rule out a software problem
    - Reset the iPod. Nothing will be lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iPod.
    If the speaker still does not work, make an appointment at the Genius Bar of an Apple store. Seems you have a bad headphone jack.
    Apple Retail Store - Genius Bar
    If not under warranty Apple will exchange your iPod for a refurbished one for this price. They do not fix yours. The Apple warranty is for one year unless you purchased the optional Applecare extended warranty
    Apple - iPod Repair price                  
    A third-party place like the following will replace the jack for less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens
    Replace the jack yourself
    iPod Touch Repair – iFixit

  • Can you fix my screen on my ipod??

    Can you fix my screen??

    You are not addresing Apple here. We are all just users like yourself.
    Unless yo purchased the options AppleCae+ extended warranty,
    Apple will exchange your iPod for a refurbished one for $99 US for 16 GB 5G and $149 for the other 5Gs. They do not fix yours.
    Apple - iPod Repair price                                    
    A third-party place like the following maybe less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens         
    Replace the screen yourself if you are up to it
    iPod Touch Repair – iFixit                  

  • TS4036 can you fix my email on my ipod tuch

    can you fix my ipod tuch email

    You are not addresing Apple here. We are all just users like yourself.
    Unless yo purchased the options AppleCae+ extended warranty,
    Apple will exchange your iPod for a refurbished one for $99 US for 16 GB 5G and $149 for the other 5Gs. They do not fix yours.
    Apple - iPod Repair price                                    
    A third-party place like the following maybe less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens         
    Replace the screen yourself if you are up to it
    iPod Touch Repair – iFixit                  

  • My mac pro's power adapter has something wrong, sometime can work, sometime dosen't, can you fix it?

    my mac pro's power adapter has something wrong, sometime can work, sometime dosen't, can you fix it? i brought this mac pro last year.

    No, we can't fix it. Probably live half the world away from you and don't have telephatic powers....
    But you can try yourself. First, make sure the connector is absolutely clean. The gold pins on the cable end should all move freely and fully extend out. The gold pads on the Mac connector should be spotlessly clean, and the area around them, where the metal ring on the cable goes in, should be free of any debris that may impede full seating and contact.
    Next, the cable on the power brick should be in good condition, without kinking or fraying. If there is any damage, only solution is replacement, it is not serviceable.
    Lastly, make sure the battery is ok. Go to the About This Mac item in the Apple menu, do More Info... / System Report... and select Power on the left column. In the Battery Information, Health section, make sure the Condition is Normal. Else, will need replacement.

  • How can you fix your ipod touch when apps are closing on you, how can you fix your ipod touch when apps are closing on you

    How can you fix your ipod when apps keep crashing on you while your in that app?

    See:
    iOS: Troubleshooting applications purchased from the App Store
    Contact the developer/go to their support site if only one app.
    Restore from backup. See:
    iOS: How to back up              
    Restore to factory settings/new iPod

  • How can you fix your iphone5 if it freezes?

    How can you fix your iphone5 if it freezes?

    Straight from the User Guide:  do a reset--hold the on/off switch and home button together until the Apple logo appears, generally around 20 - 30 seconds.

  • Why am I not able to type into my pdf files. Why is the cursor only appearing at he areas where there in no typing? I believe I know who's doing this, but can you fix the problem for me please?

    I cannot type into one of my pdf files. The cursor only appears where there is no typing. I believe there is foul play going on on my computer, Can you fix this problem?

    Hi Donna,
    Let's see if we can get to the bottom of this mystery! I hope it's not foul play.
    You say the problem is with just one of your PDF files? What version of Acrobat/Reader are you using? If you're in Reader, you're limited to commenting/annotating the PDF (you can't edit text with Reader, so you wouldn't be able to select text that's in the PDF already).
    Please let me know what program/tools you're using and we can take it from there.
    Best,
    Sara

  • Has anyone else had an unsaved photo disappear from a text message?Gone. No thumbnail... it doesn't exist anymore? How do you fix that? Can you fix that?

    The photo is gone in the text message. Gone. No thumbnail...it doesn't exist anymore. How do you fix that? Can you fix that? Can you ever get the photo to show up again? I stumpted the guy on the phone with this problem. I need some help from anyone who has experienced this problem and might have a solution! Thanks in advance!

    This happened to me also, a few days ago... I went to look at pics that were sent from just one person, all the other photos that people texted are there during same time period.  It is only this one contacts several photos that disappeared...   There is an arrow when I click on it it goes to a blank page?!?   Have you received any feedback or answers??  Did your photos  that are missing come from only one person or multiple?  If you have any information that might help let me know!!!  I really want them back!!  Thanks much!

Maybe you are looking for

  • Free of charge goods.

    Hi All, I have a requirement with free of charge functionality. It  needs to be possible to assign free products retroactively for a certain time period and calculate the number of free products by the number of products ordered in the given period.

  • Simple Search Strings

    HI We have EBS in place just to explore new things to enhace EBS for clearing we are trying to use Search strings. We  just create dummy EBS file to check a scenario as below example We receive check number 6=4 digits after NCHK pref CH#1028. In our

  • Version 8.5 and Version 11.5 on same machine

    Post Author: ashleyp CA Forum: Older Products I've heard that loading version 8.5 and version 11.5 on the same pc can be done, but the loading needs to be done in a particular order.  Does anyone have experience with this? Thanks, Ashley

  • IP address 192.168.1.255 active every 30 seconds - why?

    The IP address 192.168.1.255 is active every 30 seconds - why? I use Virus Barrier and also Little Snitch to monitor network receiving and sending activity... Since I began this process I've been baffled by the fact that this particular IP address, 1

  • CS 5.5 H.264 Serious Render Bug - bad encoding

    I have Adobe After Effects CS5.5 on Windows 7 SP1. This problem has been reported by dozens of our customers, and happening on many, many videos made by me and my two freelancers. Many of our videos give playback erros on professional presentation so