BridgeTalk run the command

Hello again,

I wrote up here this bit of code that uses bridgetalk to loop through each page InDesign document copy and then send Illustrator where it is glued to a new work plan. The problem is that orders sent to illustrator don't are not made at the end of each course, but rather the end of the script once all the instances in the loop have been crossed. Since all paste commands are executed at the end instead of after each loop that paste uses what ever was finally copied in the Clipboard the last page of the InDesign document is pasted on all pages in the Illustrator document.

I wonder if there is some kind of run command that I can add to my loop that will cause illustrator to perform each loop after what happens rather than all the loops together in the end?

Here is my code.

Any thoughts?

Thank you and best regards,

Dane

inDoc var = app.activeDocument;

Starter()

for (var i = 0, ii = inDoc.pages.length; i < ii; i ++) {}

myPage var = inDoc.pages.item (i);

thisThing = 0

var thisThing = myPage.pageItems.everyItem ();

App.Select (thisThing);

App.Copy (thisThing);

Paste (thisThing);

};

function starter() {}

var bt = new BridgeTalk

BT. Target = "Illustrator".

BT. Body = ' var illDoc = app.activeDocument; illDoc.artboards.add ([-7650, 0, - 6808, - 595]); « ;

BT. Send();

};

function Paste (thisThing) {}

var bt = new BridgeTalk;

BT. Target = "Illustrator".

BT. Body = "var illDoc = app.activeDocument;" var abIdx = illDoc.artboards.getActiveArtboardIndex (); var abActive = illDoc.artboards [abIdx]; var newBoardTop = abActive.artboardRect [2] + 25; var newBoardWidth = abActive.artboardRect [2] + 842 + 25; »

+ ' illDoc.artboards.add ([newBoardTop, 0, newBoardWidth,-595]); App.Paste (); app.executeMenuCommand ('group'); var curGroup = illDoc.layers [0] .groupItems [0]; var posRefTop = newBoardTop + 56,69; var posRefLeft = - 51; »

+ ' curGroup.position = [posRefTop, posRefLeft]; " ;

BT. Send();

};

Hello

Why not through a PDF export and re-import of HAVE it?

var main = function() {
  var doc = app.properties.activeDocument, shortName,
  files, file, pages, page, arr = [];

  if (!doc ) return;

  shortName = doc.name.replace ( /\.indd$/i,"" );
  fo = Folder( Folder.temp+"/"+shortName );
  !fo.exists && fo.create();
  files = fo.getFiles ( function ( f ) { return /\.pdf/i.test (f.name) } );

  while ( file = files.pop() ) {
  file.remove();
  }

  pages = doc.pages.everyItem().getElements().reverse();

  while ( page = pages.pop() ) {
  file = File ( fo+"/"+shortName+"_"+page.name+".pdf" );
  doc.exportFile ( ExportFormat.PDF_TYPE, file);
  arr [ pages.length ] = file.fsName;
  }

  placeFiles ( arr );
}

function placeFiles (arrayOfFiles ) {
  var aiScript = "("+placeFilesInAI.toSource().replace(/(^\(|\)$)/g, '' )+")(\""+arrayOfFiles.join("##")+"\")";
  var bt = new BridgeTalk;
  bt.target = "illustrator";
  bt.body = aiScript;

  bt.send();
}

function placeFilesInAI ( files ) {
  var doc = app.documents.length? app.activeDocument : app.documents.add(),
  url, placed, ab, abs,
  files =files.split("##");
  var rect = [-7650,0,-6808,-595], gap = 942;
  while ( url = files.pop() ) {

  abs = doc.artboards;
  rect[0]+=gap;
  rect[2]+=gap;

  ab = abs.add(rect);
  abs.setActiveArtboardIndex ( doc.artboards.length-1 );
  placed = doc.placedItems.add(); placed.file = File ( url );
  placed.left = rect[0];
  placed.top = rect[1];
  placed.embed();
  }
}

main();

FWIW

Loïc

Ozalto | Productivity-oriented - Loïc Aigon

Tags: InDesign

Similar Questions

  • Run the command in Start menu show sites and other files that I opened.

    I was typing letters in the menu run from the start menu ("Start" > "run" > "a, b, c, d, e, f, g, etc...) and I noticed that the Web sites I visited were stored there. This information is accessible by hackers or other intruders unwanted? I was checking to see if I could find my e: drive using the command run from the start menu when I noticed similar entries in the recent documents folder from the start menu. I forgot this shortcut in the past and by chance came across it accidentally. How to delete these lists. I've seen websites that need my e-mail and password. even if she had a lot of jibberish, some words were read by me at a superficial glance. What is a security breach? example: if I type only (a), then all files and websites beginning with a are displayed

    Hi Marc,

    Welcome to the Microsoft Community Forums.

    According to the description, it seems that you are facing problems in removing the story from the beginning, run the command. I'll be happy to help you in this problem.

    -What operating system is installed on your computer?

    Windows saves a history of the names of files, programs, and locations that you type in the Run dialog box. You can delete this history, which you can do if you use a public or shared computer.

    I suggest you follow the steps in the link to clear the history run in the start menu and check if it helps.

    Clear history run on the start menu

    http://Windows.Microsoft.com/en-us/Windows7/clear-the-run-history-on-the-start-menu

    I hope it helps. If you have any questions about Windows in the future, please let us know. We will be happy to help you.

  • Is it possible to run the command script with user account administrator rights?

    Is it possible to run the command script with administrator user account rights means please tell me how to...

    I need to run it in windows 7 professional service pack 1.

    There are a few myths that won't go away, for example

    • You can perform administrative tasks when you are working from a command prompt.
    • A script (batch file, VBScript, PowerShell) gives you administrative rights.

    There is no substance to a myth. Your account has administrator privileges, or it does not. There is no backdoor.

  • Runs the command "regsvr32 quartz.dll" shows 0 x 80040154 error and the laptop webcam does not work

    Runs the command "regsvr32 quartz.dll" shows 0 x 80040154 error and the laptop webcam does not work

    Hello

    Thank you for your response.

    I appreciate that you have attached a screenshot of the problem.

    Have you tried troubleshooting of hardware and devices running?

    Please refer to the suggestions of Naman R responded on 1 April 2011 and check if that helps.
    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-windows_programs/DllRegisterServer-failed-with-error-code-0x8002801/403ee0d0-895B-E011-8dfc-68b599b31bf5

    Note: Serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:
    http://Windows.Microsoft.com/en-us/Windows/back-up-registry

    I hope this helps.

    Thank you

  • Installed dictionary software (babylon 8), but I saw this message: "error 0 runs the command setup32.exe. How to solve this problem?

    Original title: error setup32.exe

    Hello. Thank you for your reading this question.

    I was installing a software dictionary (babylon 8), but I saw this message: "error 0 runs the command setup32.exe. Can you help me to solve this problem?

    Moved Windows 7 installation, set at level and activate Forum.

    Hello

    I changed the windows of my laptop and the problem has been resolved.

    Thank you very much.

  • Runs the command msiexec/v carry out any action in Windows 7?

    Is any action run the command msiexec/v in a command window in Windows 7 64 bit?

    Is the command msiexec/v identical to msiexec.exe/v?

    That means / V for the msiexec command do?

    I was not aware that the cmd was available in win7, but returned to winxp

    http://support.Microsoft.com/kb/314881

  • How to disable the prompt 'more' when you run the command 'See logging' CLI

    Hello. I would like to know if there is a command that I can run to disable paging on my SF302 switch.

    Thus, for example, when I run the command 'See logging' on the CLI, I care about her return all results rather than ask me hit the SPACEBAR or enter.

    Is there a way to do this?

    Thanks in advance for your time and your consideration.

    J.L.

    command is

    terminal datadump

    -Tom
    Please evaluate the useful messages

  • How to run the command in Windows 7?

    Original title: HOW can I PUT to the TOP of THE COMMAND WINDOW TO INSTALL a PROGRAM IN WINDOWS 7 a LITTLE WI... UNDER XP, I WENT TO RUN AND OPEN NOCK THEN HE TYPED IN THE COMMAND

    INXP I COULD BRING UP THE LITTLE TH WINDOW TYPE IN THE INSTALLATION PROGRAM. EXE TO INSTALL THE PROGRAM I CAN T FIND THAT IN WINOWS 7

    As long as you are trying to run a 16-bit program on 64-bit Windows, then try either Windows key + R or click Start (or press the Windows key), and then simply type (or paste it into your order for the text box search programs and files ), then press on .

    If you think you really need to run window, you can add it by customizing the Start Menu. Right-click the Start button, and then select Properties. Click the Customize button at the top right.


    Figure 1.0 - Customize Start Menu dialog

    Scroll down about three quarters of the way down the list of options and place a check next to run the command. Click OK to save your changes and OK to save the Properties dialog box again.

    The familiar run command should be back on your Start menu in the menu on the right pane. The window run keep a history of previous orders drop.

    • "Have you tried it turned off then on again? '-'The IT Crowd' Roy (Emmy award-winning British comedy)
  • command prompt does not work well. He is unable to run the commands like 'help, tree, ipconfig, netstat', n many more

    the command prompt in my system has attracted some problem. A few months ago, it was all fine. BT now its disturbing. do not run the commands of other than "exit".

    even in the bar of tasks run these commands will not be executed.

    Type has the VALUE

    Copy the output and post with your response.

  • Run the command in the comments: dnscmd

    I use the command run in comments to run commands on a host windows below. The account that runs the command has permissions to run these commands.

    cmd.exe /c dnscmd xx.xx.xx.xx hostName1 some.dns.host /recorddelete has xx.xx.xx.xx/f

    cmd.exe /c dnscmd xx.xx.xx.xx /recorddelete some.dns.host hostname1 PTR/f

    (real info IP and host names are hidden to protect the innocent)

    Both run successfully (and should be) run interactively from a CMD prompt, I get the expected result and indicates a nslookup on the hostname '... cannot find < hostname >: field Non-existend' as expected. (img1 attached)

    If run via the command run in the comments, the first command runs (to delete the a record, however, while the second command seems to work, the PTR record is not deleted and nslookup on the hostname returns ' name: < hostname > '(attached img2))

    Thoughts?


    Here is an excerpt of the object 'command' treatment of an article on my blog: How to run a PERL Script from a vCenter Orchestrator Workflow

    
    // Prepare Command line and parameters to execute:
    
    cmd = scriptName + " " + scriptParams;
    
    System.debug("executing cmd: " + cmd);
    
    // Create and execute the command:
    
    var command = new Command(cmd);
    
    command.execute(true);
    
    // Display command results and output 
    
    var scriptResult = command.result;
    
    System.debug("Script Result: " + scriptResult);
    
    var scriptOutput = command.output;
    
    System.debug("Script Output: " + scriptOutput);
    

    As you can see from the code above, you'll want to look at the results and the exit of the execution of the object of your cmd. I hope that this release will contain some clues as to why your second command fails...

  • Run the command of MaxL througth ODI and encrypt the password

    Hello

    I'm looking for a solution not using password plain text for my order Maxl in ODI.

    Someone knows how can I do?

    So far, I found nothing.

    Thank you

    Alain

    Hello

    Here is an example to encrypt the connection information in a scipt maxl.

    Something like this first run the command prompt
    essmsh - gk > c:\temp\encryptKeys.txt

    This will create a text file with the key public and private for example
    for example
    Public key for encryption: 5407,1453704157
    The private key for decryption: 406488703,1453704157

    Now that you have a maxl file called login.mxl as

    login password admin on localhost.
    disconnection;

    You can encrypt by calling
    essmsh EI c:\temp\login.mxl PUBLIC KEY

    So for this example, it would be
    essmsh EI c:\temp\login.mxl 5407,1453704157

    This will create a file called login.mxls with encrypted for example connection details

    Login $key 6343689380045143584028576355606972733930 1468602100275634090163724540502857635560 localhost $key;
    disconnection;

    Now, to run the file, you must use the command
    essmsh d c:\temp\login.mxls PRIVATE KEY

    Thus, in this example
    essmsh d c:\temp\login.mxls 406488703,1453704157

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Run the command

    When I use the command "run" say - ipconfig - the config appears on the screen, but the window is then immediately closed and I don't get a chance to read the screen. Is there a setting that can change this so that the window / screen stays on until the closing manually. Thank you very much

    Glad to see that you did it :-)

    I'll ask the Japanese forum moderators to close your issue.

    Great job to refine your question, btw!

    Oh, and be sure to "Mark as answer" Jeeped response if you found it useful.

  • Please help me. My task manager disappeared, also run the command

    I have automatic updated my computer this morning. After the update, I had to reboot my computer. After the reboot, my task manager disappeared, I received a message that it is disabled by the administrator. The thing is, I am the administrator. I tried to bring it using command run, but he went too. I tried the command run in the properties of the start menu, impossible to find. How can I bring back?

    Another thing, all my word files are now listed as files Visual Basic EDITOR. I guess it's because of virus. I turned off to avoid any automated scripts from script virus running, but then I can't open any word file, so I still allowed him. I can open word file after that, but they are still reported VBEfile. What is VBEfile anyway?

    Another problem, the automated system recovery tab is also missing from my computer properties after the update.

    Please help me, I'm desperate here.

    If you see things like this:

    You do not have sufficient security privileges to restore your system.
    The System Restore tab is missing from the my computer properties.
    System Restore has been disabled by group policy.  To turn on system restore, contact your domain administrator.
    The System Restore tab is available, but the turn off System Restore (disabled by Group Policy) box is grayed out.
    The task manager has been disabled by your system administrator.
    The registry editor has been disabled by your system administrator.
    The task manager has been disabled by group policy.
    The registry editor has been disabled by group policy.
    The command prompt has been disabled by your administrator.  Press a key to continue...
    The operation has been cancelled due to restrictions in effect on this computer.  Please contact your system administrator.
    The "Run" option is missing from the start menu.
    The option "Log off."... ' is missing from the Start Menu.

    The usual advice are something in the sense of "something has been disabled in the group policy...". ", and it is probably true that something has been disabled, but you know what something is and what it takes to do about it.

    If you are using XP Home Edition, you will get away with advice to use the Group Policy Editor, because there is no Group Policy Editor in XP Home and that really doesn't tell you where to look in group policy, even if you run the Group Policy Editor.

    You need a complete solution that works for all versions of XP and requires no hunting around in the Group Policy Editor or registry to find where things are that have been disabled.

    Unless you have disabled these things on purpose, chances are good that your system has a malware infection.  The malware knows what tools you use to try to find and remove, for the malware disables the things you are more likely to consume and prevents them from running if you can't find the malware and remove it.

    If your system has this kind of affliction, all malicious software tools you currently use or have used failed to protect your system so that you can expand your horizons malware detection and prevention to prevent these kinds of afflictions in the first place.

    The malware will be happy you trick into thinking that you need to so something drastic to fix your system - as a facility repair, system restore point or a total reinstallation of XP.  This is what it would be like you, but these measures are not necessary.

    You must solve the immediate problem of the tools does not, then scan your system for malware when you are finished.

    No matter what kind of malware you've used analytical tools, they are unlikely to solve this problem, because they cannot tell if the changes made to your system have been on purpose (you or an administrator who makes them) or some malware changed them, so the analysis tools will let these things alone (it's usually a good thing).

    If your system is afflicted in this way, there are probably other things that also do not work - like the registry editor, System Restore and the command prompt, so fix them all at once even if you have not discovered they are broken again.

    These commands from registry removes the registry entries that are stop opening programs.  Although the registry entries do not exist, these commands are safe to run and will work for all versions of XP.

    Before making any changes to your registry, back up the registry with this free and popular tool:

    http://www.SnapFiles.com/get/ERUNT.html

    Open Notepad to create a new text file:

    Click Start, run and enter in the box:

    notebook

    Click OK to open a new Notepad file.

    Copy and paste the following lines in bold text in the new Notepad file.

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
    "DisableTaskMgr" = -.
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
    "DisableRegistryTools" = -.
    [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System]
    "DisableCMD" = -.
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem\\\]
    "DisableTaskMgr" = -.
    [HKEY_USERS\.default\Software\Microsoft\Windows\CurrentVersion\Policies\System]
    "DisableTaskMgr" = -.
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
    "DisableCAD" = DWORD: 00000000
    [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\SystemRestore]
    "DisableConfig" = -.
    [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\SystemRestore]
    "DisableSR" = -.
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
    "NoRun" = -.
    [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
    "NoRun" = -.
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
    "NoClose" = -.
    [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
    "NoClose" = -.
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
    "NoSetTaskbar" = -.

    Save the new text file with extension .reg on your desktop or somewhere you can remember with a name you can remember, something like:

    enableit.reg

    After you save the file, close Notepad.

    Locate the file enableit.reg on your desktop and double-click it.

    Alternatively, you can right-click on the enableit.reg file, choose open with... and select the registry editor.

    Answer in the affirmative to the question... Are you sure you want to add the information in the registry?

    You should then see a message that information has been registered in the register.

    Reboot your system and test.

    You can delete the enableit.reg file when you are finished.

    If the registry editor has also been disabled, we first fix (not a problem).

    Because now you have or have had a malware infection, I would follow with this:

    Download, install, update and do a full scan with these free malware detection programs:
    Malwarebytes (MMFA): http://malwarebytes.org/
    SUPERAntiSpyware: (SAS): http://www.superantispyware.com/
    They can be uninstalled later if you wish.
  • XP does not start, unable to run the command line for the clean boot

    Hello

    For the last two weeks, I've been unable to boot XP, caused by a virus, I think. I can get into safe mode, but stopped to run antivirus software because I said that I don't have the appropriate privileges. There is no system restore points available, and I think that my computer is too old for me to ask the manufacturer (HP) for an OEM drive.

    Now that I found this forum, I decided to try the suggestion of the thread stickied for a clean boot, but I can't even click on RUN and load the command prompt. I click, but nothing happens. Many programs in safe mode did the same thing for me.

    Is there another way to enter the guest so I can try to get a clean boot? Is there another way to access msconfig? I read here that I can click on F10 to try HP and XP 'factory re - install', but the HP splash screen is no longer, perhaps due to a new card mother MSI, I put a few months ago. Any help?

    If all else fails, I buy a Windows 7 Upgrade disk and which will still work? Or would I need to buy the complete installation of W7 to "clean up" my system?

    Thank you.

    Jacob S.,.
    Thanks for posting with us.  Have you tried to run MSConfig from safe mode?  If the immediate window does not work, you can right click on your taskbar and start the Task Manager.  From there, you can select file > new task > and then type msconfig in the window.

    With respect to obtaining OEM disc, you may be able to buy them from HP, but since you have replaced the motherboard and then the OEM disc probably does not work.  You should check with HP on this one.

    If you buy the upgrade to Windows 7 you can do a clean install, but it should be started from Windows.  You insert the DVD in the drive so that the desktop, and then select the custom Setup to perform a clean installation.  It will validate your XP before you start the installation.

    Now if you think that your PC has a virus (which it sounds like it might) then you can try using a free online virus scan.  You should be able to run one of them without blocking.  Also, make sure that you log on with an administrator account.  Here is a link to a scan online, that you can try, or you can search bing for others that are out there.
    http://OneCare.live.com/site/en-us/default.htm Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to run the command sfc runs on Vista

    My dept here reimagee IT my computer today and I'm unable to access my WD external drive. WD has suggested to get help with the sfc command before possibly spoil my data. Anyone have any ideas?

    Thank you

    Hello

    Run the sfc/scannow command.

    http://support.Microsoft.com/kb/929833

    Use the (SFC.exe) System File Checker tool to determine which file is causing the problem and then replace the file. To do this, follow these steps:

    1. Open an elevated command prompt. To do this, click Start, click principally madeprograms,Accessories, right-clickguest, and then clickrun as administrator. If you are prompted for an administrator password or a confirmation, type the password, or clickallow.
    2. Type the following command and press ENTER:
      sfc/scannow

      The sfc/scannow command analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions

    you have a newly imaged drive today while there should be no problem with the operating system

    SFC is only to solve minor problems

    for the major problems you will need to do a repair installation

    but this does not apply to you in your case that your IT Dept use not reimage repair

    I suggest that you go and talk to your IT Department

    ask them about the last vista hardware drivers for your hardware of computers

    and your IT Department is responsible for your safe running of computers

Maybe you are looking for

  • No free space after deleting files - trouble with optimized storage?

    Hi, I have macos Sierra and I deleted many files to my main drive and also to my external hard drive (both to the Mac OS Extended format) in preparation for the boot camp. I also emptied the Recycle Bin, although there is much less space on the two d

  • Re: Satellite A500 - 14L: must place LCD in a certain position to have the image

    I have an A500 - 14LRecently, the LCD cable from the motherboard has started giving me (hardly the hindge)I need to put the screen in a certain position in others having the right picture on the LCD Where can I buy a new cable?PC bought in France (st

  • Possibility to choose synchronization options disappeared

    The ability to choose what Google Apps to synchronize has disappeared, even on T-Mobile. Boxes/circles have disappeared. What is going on? I don't want to sync with Google Calendar, Google Gmail or T-Mobile. Google contacts is the only file I want sy

  • drivers of Windows 8...

    Mr President, I am upgrading windows 8 Windows 7 on my computer hp laptop 2000-2110 you,. and I have a backup of all the drivers in win7, I use these drivers for installation on windows 8? Der difference between win 7 and 8 to win drivers?

  • Crysis stuck on black screen on Windows 7 Home Premium 64-bit

    OK, for starters, I had Crysis installed on my system before but had to reinstall Windows and now nothing does, not even Fallout 3 GOTY Edition on my system, I have more then qualify for a game but I am still having problems.-------------------------