Combining two illustrator scripts

Hi I have one problem. i dont know javascript but i neet to combine two scripts in one.
first script:
var doc = app.activeDocument;
var docname = (doc.name.split('.'))[0]; // name
var doc_artboard = doc.artboards[0].artboardRect;
if (app.documents.length > 1) {
        alert( "Please close other documents, and run the script again");
} else {
    var ok = confirm( "Please save your original file before continue.\n\nLayer files will be saved in the same folder as the original file. Original file will be closed without saving.\n\nContinue?" );
    if (ok) {
        // prepare layers
        for(var i=0; i<doc.layers.length; i++) {
            doc.layers[i].visible = false;
        // go through each layers
        for(var i=0; i<doc.layers.length; i++) {
            app.activeDocument = doc;
            if (i>0) doc.layers[i-1].visible = false;
            doc.layers[i].visible = true;
            doc.activeLayer = doc.layers[i];
            saveAI( doc.path, doc.activeLayer.name, i );
        // close original file without saving
        doc.close( SaveOptions.DONOTSAVECHANGES );
function saveAI( path, name, id ) {
    var currlayer = doc.layers[id];  
    var g = currlayer.groupItems.add();
    group( g, currlayer.pageItems );  
    var t = g.top;
    var l = g.left;
    var newdoc = app.documents.add ( doc.documentColorSpace, doc.width, doc.height);
    newdoc.artboards[0].artboardRect = doc_artboard;
    var newlayer = newdoc.layers[0];
    g.duplicate( newlayer, ElementPlacement.PLACEATBEGINNING );
    newlayer.pageItems[0].top = t;
    newlayer.pageItems[0].left = l;
    path.changePath( docname+"_"+name+".ai" );
    newdoc.saveAs( path );
    newdoc.close( SaveOptions.DONOTSAVECHANGES );
    // wait for the new file to save and close before continue.
    // A callback function (if possible) will be better than a while loop for sure.
    while (app.documents.length > 1) {
        continue;
function group( gg, items ) {
    var newItem;
    for(var i=items.length-1; i>=0; i--) {
        if (items[i]!=gg) {
            newItem = items[i].move (gg, ElementPlacement.PLACEATBEGINNING);
the second one:
if (app.documents.length > 0) {
     var docRef = app.activeDocument;
     if (docRef.artboards.length > 1)
          alert('Need exactly one artboard');
          quit;
     // Found 1 artboard
     var myVisibleBounds = docRef.pageItems[0].visibleBounds;
     // The VisibleBounds rect is in this order: left, right, top, bottom
     // so use variables to show which side we are using
     var myLeft = 0;   var myRight = 1;   var myTop = 2;   var myBottom = 3;
     for ( var i = 1; i < docRef.pageItems.length ; i += 1 )
          // We want the ultimate maximum bounds, so select the minimum left and bottom, and max right and top of our rect.
          myVisibleBounds[myLeft  ] = Math.min( myVisibleBounds[myLeft  ], docRef.pageItems[i].visibleBounds[myLeft  ] );
          myVisibleBounds[myRight ] = Math.max( myVisibleBounds[myRight ], docRef.pageItems[i].visibleBounds[myRight ] );
          myVisibleBounds[myTop   ] = Math.max( myVisibleBounds[myTop   ], docRef.pageItems[i].visibleBounds[myTop   ] );
          myVisibleBounds[myBottom] = Math.min( myVisibleBounds[myBottom], docRef.pageItems[i].visibleBounds[myBottom] );
     // We have our maximum bounds, so use it to set the document's (only) artboard
     docRef.artboards[0].artboardRect = myVisibleBounds;
else {
     alert('Open a document before running this script', 'Error running FitArtboardToArt.jsx');
Anyone cn help me please.

if (app.documents.length > 0) {
     var doc = app.activeDocument;
     if (doc.artboards.length > 1)
          alert('Need exactly one artboard');
          quit;
     // Found 1 artboard
     var myVisibleBounds = doc.pageItems[0].visibleBounds;
     // The VisibleBounds rect is in this order: left, right, top, bottom
     // so use variables to show which side we are using
     var myLeft = 0;   var myRight = 1;   var myTop = 2;   var myBottom = 3;
     for ( var i = 1; i < doc.pageItems.length ; i += 1 )
          // We want the ultimate maximum bounds, so select the minimum left and bottom, and max right and top of our rect.
          myVisibleBounds[myLeft  ] = Math.min( myVisibleBounds[myLeft  ], doc.pageItems[i].visibleBounds[myLeft  ] );
          myVisibleBounds[myRight ] = Math.max( myVisibleBounds[myRight ], doc.pageItems[i].visibleBounds[myRight ] );
          myVisibleBounds[myTop   ] = Math.max( myVisibleBounds[myTop   ], doc.pageItems[i].visibleBounds[myTop   ] );
          myVisibleBounds[myBottom] = Math.min( myVisibleBounds[myBottom], doc.pageItems[i].visibleBounds[myBottom] );
     // We have our maximum bounds, so use it to set the document's (only) artboard
     doc.artboards[0].artboardRect = myVisibleBounds;
else {
     alert('Open a document before running this script', 'Error running FitArtboardToArt.jsx');
//Saves out layers as seperate files
var docname = (doc.name.split('.'))[0]; // name
var doc_artboard = doc.artboards[0].artboardRect;
if (app.documents.length > 1) {
        alert( "Please close other documents, and run the script again");
} else {
    var ok = confirm( "Please save your original file before continue.\n\nLayer files will be saved in the same folder as the original file. Original file will be closed without saving.\n\nContinue?" );
    if (ok) {
        // prepare layers
        for(var i=0; i<doc.layers.length; i++) {
            doc.layers[i].visible = false;
        // go through each layers
        for(var i=0; i<doc.layers.length; i++) {
            app.activeDocument = doc;
            if (i>0) doc.layers[i-1].visible = false;
            doc.layers[i].visible = true;
            doc.activeLayer = doc.layers[i];
            saveAI( doc.path, doc.activeLayer.name, i );
        // close original file without saving
        doc.close( SaveOptions.DONOTSAVECHANGES );
function saveAI( path, name, id ) {
    var currlayer = doc.layers[id]; 
    var g = currlayer.groupItems.add();
    group( g, currlayer.pageItems ); 
    var t = g.top;
    var l = g.left;
    var newdoc = app.documents.add ( doc.documentColorSpace, doc.width, doc.height);
    newdoc.artboards[0].artboardRect = doc_artboard;
    var newlayer = newdoc.layers[0];
    g.duplicate( newlayer, ElementPlacement.PLACEATBEGINNING );
    newlayer.pageItems[0].top = t;
    newlayer.pageItems[0].left = l;
    path.changePath( docname+"_"+name+".ai" );
    newdoc.saveAs( path );
    newdoc.close( SaveOptions.DONOTSAVECHANGES );
    // wait for the new file to save and close before continue.
    // A callback function (if possible) will be better than a while loop for sure.
    while (app.documents.length > 1) {
        continue;
function group( gg, items ) {
    var newItem;
    for(var i=items.length-1; i>=0; i--) {
        if (items[i]!=gg) {
            newItem = items[i].move (gg, ElementPlacement.PLACEATBEGINNING);

Similar Messages

  • Linking FileInfo Panel to an Illustrator Script

    I've got an Illustrator script (Javascript) that writes XMP based on the content of the artwork, but the script has to be manually triggered. I've got a custom FileInfo panel (built with Flex/AS3) to help me edit the XMP once stored.
    I'd like to combine the two, so the Script fires whenever the FileInfo panel opens.
    I can't do the DOM scripting directly in AS3, can I? I think that Illustrator is only open to Javascript, VB, and AppleScript. Please correct me if I'm wrong.
    Does anyone have any ideas how to call the javascript in the Scripts folder from an event in the FileInfo panel's SWF, and pass arguements back and forth? I've seen it done on webpages, but only when both the SWF  and javascript are on the same HTML page.
    Thanks

    Thanks Carlos, this led me in the right direction, but not quite far enough.
    I found Zac's Cookbook on jsxInterface, but it isn't working for me. I've set up the project linking the SWCs as directed by the SDK (csaw, apedelta, etc.), but when I use his code, I get error 1120 access of undefined property error.
    I think I've imported all of the classes that I need. I'm thinking that I might have the javacript in the wrong folder of my project (although I've tried it in several, its in the src folder of the project with the mxml file), or that the javascript itself isn't valid (I've checked that it is).
    Any ideas what I'm missing to make this work?
    Thanks,
    Alex
    import com.adobe.csawlib.*;
    import com.adobe.illustrator.Application;
    [Embed (source= "myScript.jsx" , mimeType= "application/octet-stream" )]
    private static var myScriptClass:Class;
    var jsxInterface:HostObject = HostObject.getRoot(HostObject.extensions[0]);
    jsxInterface.eval(new myScriptClass().toString())

  • Combine two resultset sidebyside in coulmn using mdx

    hi i am new to mdx,
    i want to combine two select statement resultset (side by side like union) using mdx query,please any body help me to solve this query
    first query:
     SELECT
    { [Last Year] }
    ON COLUMNS,
     { {[Location].[Location].&[7], [Location].[Location].&[12], [Location].[Location].&[11],
    [Location].[Location].&[19], [Location].[Location].&[17], [Location].[Location].&[16],
    [Location].[Location].&[9], [Location].[Location].&[18] },{[Location].[Location].[All]}}
    ON ROWS
    FROM [Cube1]
    WHERE ( [Measures].[Labour %] )
    here [Last Year] is a calculated set
    {STRTOMEMBER("[Date].[Month].&["+ cstr(year(now())-2) +"-11-01T00:00:00]"):
            (STRTOMEMBER("[Date].[Month].&["+ cstr(year(now())-1) +"-10-01T00:00:00]"))}
    2nd query:
    WITH MEMBER [Measures].[Budget ] AS IIF(avg([Last Year],IIF(([Measures].[Budget]>0),[Measures].[Budget],null)),
                                            avg([Last Year],IIF(([Measures].[Budget]>0),[Measures].[Budget],null)),0.00),
    MEMBER [Measures].[YTD] AS IIF(avg([Last Year], IIF(([Measures].[Labour %]>0),[Measures].[Labour %],null))<>null,
                                  avg([Last Year], IIF(([Measures].[Labour %]>0),[Measures].[Labour %],null)),0.00),
    FORMAT_STRING = "Standard",
    BACK_COLOR = CASE WHEN [YTD] = 0  THEN /*White*/16777215 /*White*/  
    WHEN [YTD] <= [Measures].[Budget ] THEN 65408
         WHEN [YTD]<= [Measures].[Budget ] +5 THEN 65535
         WHEN [YTD]> [Measures].[Budget ] +5 THEN 255
    END,
    VISIBLE = 1
    SELECT
    {  [Measures].[YTD], [Measures].[Budget ] }
    ON COLUMNS,
    { { [Location].[Location].&[7], [Location].[Location].&[12], [Location].[Location].&[11], [Location].[Location].&[19], [Location].[Location].&[17], [Location].[Location].&[16], [Location].[Location].&[9], [Location].[Location].&[18]
    },{[Location].[Location].[All]} }
    ON ROWS
    FROM [Cube1]
    here   ==> [Measures].[YTD], [Measures].[Budget ] are calculated member
    i want result like in
    coulmns===> ytd,budget,nov,dec,jan,feb.,,,,,,,,,,out
    rows ====> are only locations and total(average of all locations)
    please guide me to get solution like mdx query

    Hi Vsp,
    According to your description, you want to create a calculated member to combine two members, and then set it as Default member, right?
    In SQL Server Analysis Services, we can use the script below to create a calculated members.
    create member currentcube.[Date].[Day of Week].[weekend]
    as
    {[Date].[Day of Week].&[6],[Date].[Day of Week].&[7]
    Every attribute in a dimension in Microsoft SQL Server Analysis Services has a default member, which you can specify by using the
    DefaultMember property for an attribute. This setting is used to evaluate expressions if an attribute is not included in a query. Please refer to the link below to see the detail information about specify a default member.
    http://technet.microsoft.com/en-us/library/ms174822(v=sql.105).aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to combine +two fields without submitting page (via AJAX/HTMLDB_Get)?

    Hi all,
    After my last contribution "Request for Scott Spendolini" I was able to create the scripts to update fields in forms without having to refresh the page. Thanks again to Scott, Carl and the others who helped me solving my problem.
    I have another question regarding this however. How do I combine two (or more) values on a form to fill a field with the values, for instance to create a unique Primary-key field?
    This is the example: combine the postcode and the house-number (and maybe an extension to the housenumber) in one field 'adrescode'. This uniquely identifies an adress in the Netherlands. I can 'get' the postcode to fill the first part of the adrescode, but how do I modify the scripts to 'get' the housenumber (huisnummer) and - if not left null - the extension to the housenumber?
    Here are the scripts I created to far:
    in the region source of the page I have the following Javascript:
    <script language="JavaScript1.1" type="text/javascript">
    function f_P52_getAdrescode ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=P52_getAdrescode',0);
    get.add('P52_POSTCODE',html_GetElement('P52_POSTCODE').value)
    gReturn = get.get();
    if(gReturn)
    {  html_GetElement('P52_ADRESCODE').value = gReturn  }
    else
    {  html_GetElement('P52_ADRESCODE').value = 'null'  }
    get = null;
    </script>
    and in the shared components of the application I have created an process P52_getAdrescode as follows:
    declare
      l_adrescode varchar2(16);
    begin
        l_adrescode := :P52_POSTCODE || :P52_HUISNR ;
        if :P52_HUISNRTOEVOEGING is null then
              NULL ;
        else
              l_adrescode := l_adrescode ||':'||:P52_HUISNRTOEVOEGING ;
        end if ;
        htp.prn(l_adrescode);
    -- dbms_output.put_line(l_adrescode);
    end;
    I ran this PL/SQL in the SQL-section of HTMLDB and it does what a expect: combine the values in a new string.
    In my page however, it only gets the value of postcode and puts this into the adrescode field.
    So my question is: how do I modify the Javascript (I Guess) so that also the fields 'huisnummer' and 'huisnummertoevoeging' end up in the adrescode field?
    Thanks for your help,
    Jan.

    Carl, Scott,
    I have two pages with exact the same fields and codings (as described before in this Post.
    I now have two different named functions and application processes, a javascript an process for each page. They both do the same thing, use the same code except for the page-number (:P52_ and :P92). I tried to make one process to replace both, but ran into problems when I changed the name in the get.add statement.
    Changing the get.add from: get.add('P52_POSTCODE',html_GetElement('P52_POSTCODE').value) to: get.add('POSTCODE',html_GetElement('P52_POSTCODE').value) always ends up in what looks like a complete html-(source)dump of the page in the field that has to be updated. Even when I replace the :P52_POSTCODE in the application process as well Changing back the application process and the javascript to so that both javascript and process use the :P52_ again and the function returns the correct value again. What am I doing wrong?
    I requested an online-workspace to post the application to it, but have no answer to my request yet, so I can't provide a working example at the moment....
    Thanks for your help again,
    Jan.

  • Errors and more, my first illustrator script

    First, I should mention that I started scripting for Photoshop about a month ago and have had some really motivating successes there. It led me to this one task we have that is just incredibly repetitive and boring in Illustrator that I want to script.
    I haven't gotten all the pieces in here that I need so far, and any form of help would be greatly appreciated, whether just suggestion, or really whatever. I don't mind doing research and trying things out myself.
    The purpose of this script is to open a template file we have on our network drive, ask for a folder with a collection of files (these are files provided to us that contain the info we need to make labels), place one, save with a specific name, and start over, placing the next file, till they are all on the template. We do this before we can create labels for our products. There are weeks when it has to be done 50+ times and that's pretty mind-numbing.
    The steps I think I need are:
    ask where the provided files are that need to be placed
    open template file
    make sure the folder chosen has the right type of stuff in it (PDFs)
    place the first file at specified coordinates
    embed the link
    lock the embedded link
    ask user to proof information on screen (ok to continue, cancel to stop and let user interact with file on their own) (95% of the time, there are no errors)
    use the embedded link's name as the name of the file and save it to a specific network location
    repeat until all the files in the chosen folder have been done
    I've been lurking around here for a couple days, reading up on how Illustrator works with scripting and have broken off bits and pieces of different scripts to adapt for my purposes. So far, this is what I've come up with:
    function getLabelRequests() {
         return Folder.selectDialog('Please select the folder containing label requests:', Folder('~/Desktop'));
         function placeLabelRequests(selectedFolder) {
              var myDoc;
              if (selectedFolder) {
              var fileRef = File("/Volumes/myNetworkLocation/myTemplateFile.ai")
              open(fileRef);
              myDoc = app.activeDocument;
              var firstImageLayer = true;
              var thisPlacedItem;
              // create document list from files in selected folder
              var fileList = selectedFolder.getFiles();
              for (var i = 0; i < fileList.length; i++) {
              // open each document in file list
              if (fileList[i] instanceof File) {
              // get the file name
              var fName = fileList[i].name;
              // check for supported file formats
              if( (fName.indexOf(".pdf") == -1)) {
                   // skip unsupported formats
                   continue;
                   } else {
                        // Give the file the name of the image file
                        File.name = fName.substring(0, fName.indexOf(".") );
                        // Place the label request on the artboard
                        thisPlacedItem = myDoc.layers['Job Form'].placedItems.add();
                        thisPlacedItem.file = fileList[i];
                        thisPlacedItem.position = [15,-45];
                        thisPlacedItem.embed();
         if( firstImageLayer ) {
         // display error message
         alert("Sorry, but the designated folder does not contain any recognized image formats.\n\nPlease choose another folder.");
         myDoc.close();
         getLabelRequests (placeLabelRequests());
         else {
         // display error message
         alert("Rerun the script and choose a folder with label requests, if you please.");
    // Start the script off
    placeLabelRequests (getLabelRequests ());
    So obviously there's no loop in there, which is one of my problems at this point. I know what each of these chunks of code do, but can't necessarily understand all the syntax. Particularly things like
    for (var i = 0; i < fileList.length; i++) {
    I know it's saying that the variable i is zero, and while the list of files is greater than i, do whatever that last bit means, but I don't really know why it works or how it was constructed originally.
    I haven't specified the save either, which might be why I'm running another of my problems, but I don't know how to get the name of the link to be the name of the file when it's saved. I also haven't given it a confirm to let the user proof either.
    Here's my list of problems:
    Running the script returns the image format error, even though the folder selected contains PDFs (I suppose I don't need to confirm the files are PDFs, that could just be incumbent upon the user)
    Running the script places all the files into one iteration of the template (this may be because I haven't gotten the save or the loop in there, but I think it has more to do with the function being set up the way it is)
    Obviously, it doesn't save with the link name as the file name
    I don't seem to be able to figure out how to lock the link after it's embedded.
    I also wonder if there's a way to, rather than opening-placing-saving-closing-repeat, to open-place-save, delete-placenext-save, delete-placenext-save.
    Phew, sorry for the short novel.
    Here is a copy of the template … or not. Can I not embed files in the post that aren't images?
    Here's a JPG of the AI file that I use as a template
    This document has two layers in this order normally:
    Artwork
    Job Form
    And here are the blocks I'm using as placement for the information we are provided. These are taking the place of the files that need to be placed, and again, were PDF files, but I'm uploading as JPGs because I either don't know what I'm doing, or you can't upoad those file types.

    I worked around the place options for the PDF by adding in a function I found on this forum. It detects clipping masks and deletes them.
    There's one line in here that doesn't do anything, and I'm figuring out if it needs to be changed. After the clipScan function runs, I'm telling Illustrator to place a variable at a specific position, but because clipScan modifies the variable, it no longer recognizes that group of page items as the variable. Temporarily, I've used the original place position to make sure the link sits right where I want it to, but I have to make sure that the files we are provided never look any different.
    If they do, I'll need to asign a new variable and set the position after clipScan runs, I think. If it's necessary, I'll update with the fix, otherwise I think this is the final script.
    #target Illustrator
    app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
    function getLabelRequests() {
        return Folder.selectDialog('Please select the folder containing label requests:', Folder('~/Desktop'));
    function placeLabelRequests(selectedFolder) {
        var myDoc;
        if (selectedFolder) {
            var fileRef = File("/Volumes/graphics/Standards/Job Forms/Label Job Form-5C.ai")
            var thisPlacedItem;
            // create document list from files in selected folder
            var fileList = selectedFolder.getFiles("*.pdf");
            for (var i = 0; i < fileList.length; i++) {
                // open each document in file list
                if (fileList[i] instanceof File) {
                    //open job form
                    open(fileRef);
                    myDoc = app.activeDocument;
                    // Place the label request on the artboard
                    thisPlacedItem = myDoc.layers['Job Form'].placedItems.add();
                    thisPlacedItem.file = fileList[i];
                    thisPlacedItem.position = [-50,10];
                    var myLinkName = myDoc.placedItems[0].file.name
                    thisPlacedItem.locked=true
                    thisPlacedItem.embed();
                    var clippingCount = 0
                    clipScan(myDoc)
                    thisPlacedItem.position = [15,-45];//this is the line that isn't doing anything right now.
                    redraw()               
                    //make sure the placed job form has the correct information
                    var proof = confirm ("Does the job form have the correct information?", true)//needs the redraw step above or nothing shows when the alert happens. Redraw forces Illustrator to display the actions performed so far.
                    if (proof) {
                        IllustratorSaveOptions = new IllustratorSaveOptions()
                        IllustratorSaveOptions.compatibility.ILLUSTRATOR15 //some of our printers have yet to upgrade
                        var onPO = Folder ('/Volumes/graphics/ •••Drafts•••/ • Draft Labels/ •On PO')
                        var saveFile = File(onPO + '/' + myLinkName);
                        myDoc.saveAs (saveFile, IllustratorSaveOptions)
                else alert ('Make note of the file with an error. This file will not be saved.')
                app.activeDocument.close (SaveOptions.DONOTSAVECHANGES)
        else {
            // if user cancels action, display message
            alert("Rerun the script and choose a folder with label requests.");
    // run the script
    placeLabelRequests (getLabelRequests ());
    //////////////////////////function to remove clipping paths from placed item, thanks to KennethWebb, Muppet Mark and CarlosCanto on the Adobe Illustrator Scripting forum.
    function clipScan (container) {
        for (i=container.pathItems.length-1;i>=0;i--) {
    var item = container.pathItems[i];
            if (item.clipping == true){ //screens for locked or hidden items (removed this after true:  && item.editable == true       so it no longer screens for locked or hidden items
                container.pathItems[i].remove();
                clippingCount++;

  • SAP XI - Combine Two files as one in File Adapter

    Experts,
    I want to combine two files as one in File adapter itself.  I am using a simple scenario of File-to-File where i am just sending the file from sender to receiver as it is , EXCEPT, i want to add one line at the end of the file .
    I was thinking of doing this in File adapter , avoiding any mapping program in Integration Repository ..
    ANY INDEA's ??
    Regards,
    Ashutosh

    Hey
    You have 3 options,first one can be to execute a OS command before message processing or use adapter modules to append the new line in the sender adapter.
    the second option(and better one) is to do this via message mapping.
    third option is to write a OS script and execute it after message processing on receiver file adapter.
    one thing you need to make sure is that since OS scripts run on XI server itself(not on FTP server) so in case you are picking file from FTP server and delivering to FTP ,then you can't use option 1 or 3,you can only use option 2
    Thanx
    Aamir

  • How do I combine two actions in code correctly?

    I figured out how to create my  playback controls, however I still have a problem.  I want to have an  additional button that links to a website (I have coded this correctly  with actionscript and works great.  Now I have two seperate  projects...one project has my playback controls and the other has a  button that links to a website.
    I am having problems combining both action  script codes and having everything working properly.  My code for each  is below.  How do I arrange them into one?
    Code for link to website:
    website_btn.addEventListener(MouseEvent.CLICK,gotoWebsite);
    function  gotoWebsite(evtObj:Event):void{
        var theSite:URLRequest =  new URLRequest("http://www.website.com");
         navigateToURL(theSite,"_blank");
    Code  for playback controls:
    go.addEventListener(MouseEvent.CLICK,startplaying);
    hault.addEventListener(MouseEvent.CLICK,stopplaying);
    function  startplaying(event:MouseEvent):void{
        play();
    function  stopplaying(event:MouseEvent):void{
        stop();

    the only way that could make sense is to use:
    go.addEventListener(MouseEvent.CLICK,startplaying);
    hault.addEventListener(MouseEvent.CLICK,stopplaying);
    function  startplaying(event:MouseEvent):void{
        play();
    var theSite:URLRequest =  new URLRequest("http://www.website.com");
         navigateToURL(theSite,"_blank");
    function  stopplaying(event:MouseEvent):void{
        stop();
    var theSite:URLRequest =  new URLRequest("http://www.website.com");
         navigateToURL(theSite,"_blank");

  • Combining two tables without any distinct columns between them

    Folks,

    Hi sidy2j,
    According to your description, we need to verify your table structures, and the actual results which you want to get from your tables. Please post more information for analysis.
    Assume, if you want to a one to one record mapping between  two tables without any common column between them for joining, you can refer to the following scripts to implement your requirement. For more information, see:
    http://sqlhints.com/2013/09/07/joining-two-tables-without-any-common-column-between-them-sql-server/
    If you want to match every row in the first table with every row in the second table, you can refer to the following detail.
    http://stackoverflow.com/questions/1198124/combine-two-tables-that-have-no-common-fields
    Hope it can help you.
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Need Help With Combining Two Variables For A Redirect

    Hello-
    <br />
    <br />In a different part of my site (built with ADDT) I have this script that creates a variable by combining two session variables, and then the new variable is submitted into a mysqul database table using a hidden form field:
    <br />
    <br />
    <form>
    <input type="hidden" name="exerreference" id="exerreference" value="<?php echo $_SESSION['kt_login_user']; ?><?php echo $_SESSION['kt_exer_reference']; ?> <br />" />
    <br />
    <br />There is also this part of the script in the header script:
    <br />
    <br />$ins_exer1-&gt;addColumn("exerreference", "STRING_TYPE", "POST", "exerreference");
    <br />
    <br />What I am trying to do now on another page is combine a session variable "kt_login_user" with a piece of dynamic text "AA" so that I can compare it to the field "exerreference" that was inserted into the database using the above script. If the two variables match, the idea is to have a redirect to another page.
    <br />
    <br />So in a hypothetical example, if the value of the session variable "kt_login_user " is "bestperson," and static text is "AA" then I need to create the variable bestpersonAA (because this is how the variables exist in the exerreference recordset). This variable bestpersonAA then needs to be compared to the recordset value exerreference and if they match, the page redirects to ../previous/portalpre.php. If the two variables do not match, then there is no redirect.
    <br />
    <br />Here is what I have so far:
    <br />
    <br />if (isset($_SESSION['kt_login_user']))
    <br />{
    <br />if ($_SESSION['kt_login_user'.'AA'] = $row_Recordsetexer1['exerreference'])
    <br />{
    <br /> header ("Location: ../previous/portalpre.php");
    <br />}
    <br />}
    <br />
    <br />The script doesn't work yet - it's redirecting regardless of if the two varibles match. Any ideas on the correct syntax to get this working correctly?
    <br />
    <br />Thanks
    <br />Dale</form>

    Hi Dale,
    if ($_SESSION['kt_login_user'.'AA'] = $row_Recordsetexer1['exerreference'])
    for checking whether two variables match, you´ll need the == comparison operator:
    if ($_SESSION['kt_login_user'.'AA'] == $row_Recordsetexer1['exerreference'])
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Possible to combine two xml documents into a single query?

    In ASP, PHP, etc. if I wanted to combine two tables and
    filter by one =
    item, I would create a recordset combining the two on one
    common element =
    and have one recordset. Is that possible with xml documents
    and Spry =
    datasets?
    I have xml information sent to me 4 times a day from a
    weather service. =
    This happens automatically, but the two xml documents
    (current.xml and =
    forecast.xml) are set in stone by the service. However, if in
    my Spry =
    dataset, I could combine them so I could list the 15 cities
    in a master =
    region and have tabs for the current conditions and forecast
    which would =
    each access a separate xml document but needs to do that from
    the city =
    link on the left, that would work great.
    Can I do this as I would be able to if I had a database with
    different =
    tables?
    Thanks!
    Nancy

    Hi Kin:
    They are really static xml files that are placed in a folder
    directly by =
    the weather service. The files in question are current.xml
    and =
    forecast.xml.
    And there is not one per city .. but just one of each. the
    location =
    node in current.xml and the citycode node in forecast.xml
    contain the =
    same information.
    If I were doing this in a recordset with a database, I would
    write =
    something like SELECT whatever from current, forecast WHERE =
    current.location =3D forecast.citycode AND current.location
    =3D variable =
    (which would be what is clicked on).
    This sets up a master/detail arrangement for the first one
    that works =
    fine. Click on the city code (which I have to write something
    to say If =
    location =3D FAT, document.write "Fresno" and so on) and the
    rest of the =
    current information displays fine on the right side of the
    page. Now I =
    have to marry that to the forecast.xml file so that when
    citycode =3D =
    FAT, the five day information for Fresno shows up .. and so
    on. I was =
    planning to use Spry tabs or whatever to show the data.
    <!--
    var dsCurrent =3D new Spry.Data.XMLDataSet("current.xml", =
    "weather/current");
    //-->
    </script>
    </head>
    <body>=20
    <div class=3D"MasterDetail">
    <div spry:region=3D"dsCurrent"
    class=3D"MasterContainer">
    <div class=3D"MasterColumn" spry:repeat=3D"dsCurrent" =
    spry:setrow=3D"dsCurrent" spry:hover=3D"MasterColumnHover" =
    spry:select=3D"MasterColumnSelected">{location}</div>
    </div>
    <div spry:detailregion=3D"dsCurrent"
    class=3D"DetailContainer">
    <div class=3D"DetailColumn">{phrase}</div>
    <div class=3D"DetailColumn">{temp}</div>
    <div class=3D"DetailColumn">{temp/@units}</div>
    <div class=3D"DetailColumn">{aptemp}</div>
    <div class=3D"DetailColumn">{aptemp/@unit}</div>
    <div class=3D"DetailColumn">{wndchl}</div>
    <div class=3D"DetailColumn">{wndchl/@unit}</div>
    <div class=3D"DetailColumn">{rhumid}</div>
    <div class=3D"DetailColumn">{rhumid/@unit}</div>
    <div class=3D"DetailColumn">{wind_dir}</div>
    <div class=3D"DetailColumn">{windspeed}</div>
    <div
    class=3D"DetailColumn">{windspeed/@unit}</div>
    <div class=3D"DetailColumn">{pres}</div>
    <div class=3D"DetailColumn">{pres/@unit}</div>
    <div class=3D"DetailColumn">{vis}</div>
    <div class=3D"DetailColumn">{vis/@unit}</div>
    <div class=3D"DetailColumn">{icon}</div>
    </div>
    Arnout gave me some suggestions .. but so far, I haven't
    gotten either =
    of them to work. Also I am trying to get some ideas from spry
    Samples =
    from the Spry home page/samples area, but again .. not yet.
    Thanks,
    Nancy
    "kinblas" <[email protected]> wrote in
    message =
    news:[email protected]...
    >I don't think you need to combine them just so they can
    render in a =
    tabbed=20
    > widget. We're still missing a couple of key pieces of
    information. =
    What does=20
    > the data that is used in the master region look like?
    Are what you =
    refer to as=20
    > current.xml and forecast.xml really static files? Or are
    they =
    dynamically=20
    > generated by a server side script (php/cf/etc)? There is
    one current =
    and=20
    > forecast xml per city right?
    >=20
    > I ask these questions because you may be able to simply
    set up a =
    master detail=20
    > relationship between 3 data sets and just use those
    within a region(s) =
    that=20
    > build up the tab widget. Assuming you were getting the
    list of cities =
    from a=20
    > 3rd source, you could set up something like this:
    >=20
    >=20
    > var dsCities =3D new Spry.Data.XMLDataSet("cities.xml",
    =
    "/cities/city");
    > var dsCurrent =3D new=20
    >
    Spry.Data.XMLDataSet("current.php?location=3D{dsCities::name}",=20
    > "/weather/current");
    > var dsForecast =3D new=20
    >
    Spry.Data.XMLDataSet("forecast.php?citycode=3D{dsCities::name}",=20
    > "/weather/forecast/day");
    >=20
    >=20
    > ...
    >=20
    >=20
    > <div id=3D"TabbedPanels1" class=3D"TabbedPanels">
    > <ul class=3D"TabbedPanelsTabGroup">
    >
    Current</li>
    >
    Forecast</li>
    >
    > <div class=3D"TabbedPanelsContentGroup">
    > <div class=3D"TabbedPanelsContent"
    spry:region=3D"dsCurrent">
    > {temp}{temp/@unit}
    > </div>
    > <div class=3D"TabbedPanelsContent"
    spry:region=3D"dsForecast">
    >
    > <li spry:repeat=3D"dsForecast">{name}<br
    />High: =
    {high}{high/@unit}<br=20
    > />Low: {low}{low/@unit}</li>
    >
    > </div>
    > </div>
    > </div>
    >=20
    >=20
    >=20
    > --=3D=3D Kin =3D=3D--
    >

  • How to combine two datarows (business component data) in BI Publisher

    Hi ,
    We are using BI Publisher in Siebel Environment.
    We have data coming from two business components (like from 2 diff tables)
    a) <?for-each:ssTest1?>
    b) <?for-each:ssTest2?>
    ssTest1 and ssTest2 are the business components
    We need to combine these 2 datarows (a&b) and show the data into a single combined data row for ex like <?for-each:ssTest1ssTest2?> and show all the fields in that.
    I'm not sure how we can combine these two data rows into a single combined data row and show the data.
    Any help from any one would be apprecated.
    Thanks
    PV
    Edited by: user8633002 on Oct 21, 2010 4:05 PM

    Hi sajid
    There was nothing more description about your issue in this site and I found an issue below is mostly like yours
    http://www.codeproject.com/Questions/855487/how-to-combine-two-table-value-in-rdlc-report
    In the issue above, if you want to show the two other tables in the report, I think you could combine the tables into one datatable joining on key. The link below show an example of a DataSet Helper from Microsoft about combine DataSets. Take note of
    the related content for other DataSet Helper examples. And then you could use the datatable in your RDLC.
    # HOW TO: Implement a DataSet JOIN helper class in Visual C# .NET
    http://support.microsoft.com/kb/326080/en-us
    In an alternative way, I think you could create a view in the database which combine your tables and use it in your rdlc.
    In addition, your issue is about asp.net and you could get more support in the asp.net forum whose link as below.
    http://forums.asp.net
    Best Regards
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
    href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

  • How do I combine two user accounts into one account?

    When we originally set-up our iMac, I set-up two accounts for my wife and I. Since then it has been a royal pain with music and applications sharing. How do I merge the two accounts into one?

    I found an answer to this by searching on "merging two accounts" rather than "combining two accounts." BTW, it's a little mini-nightmare if you only use "combine" on both Google and Apple support. At least this post might help others avoid the same fate.
    Here's where to go to find the answer: http://discussions.apple.com/message.jspa?messageID=5629676#5629676

  • Can I combine two pdf files by using command lines?

    Hi
    I always need to combine two pdf files into one in my regular work
    Currently, I open one of them, press ctrl+shift+I,
    find another file and double click it.
    It works but not so efficient since I need to do
    this procedure many times everyday
    So I'm looking for a better solution
    Something like command lines,
    for example:
    acrobat.exe "combine" "doc1.pdf" "doc2.pdf"
    Does acrobat have these functions or not?
    Thx &
    Best Regards

    File > Combine

  • How can I combine two itunes accounts into one?

    How can I combine two itunes accounts into one?

    Items purchased from the iTunes Store are permanently associated with the account from which they were originally purchased.  Apple provides no way to change this.
    However, if you wish to put content from two accounts into a single iTunes library, you can easily do so.  Use the command File > Add File (or Folder) to Library.

  • Is it possible to combine two existing iTune accounts and then cancelling one? Many thanks.

    I am trying to combine two accounts that I have on iTunes (created separately over the years) so as to then delete/cancel one to only have one active account (with all of my combined purchases, etc. on this combined account).
    Is this possible, or is there another way of transfering purchases to one of the accounts and then just deleting the then "empty" one?
    Thanks for any advice / input

    method one from the following support article should do the trick: How to use multiple iPods, iPads, or iPhones with one computer.

Maybe you are looking for