Subview formatting using transformation script

Hi,
We have 200+ subviews with tables consisting of roughly 100 columns a piece. After the models were created, we decided that we would only show the PK and FK columns and hide the rest. I was able to write a transformation script to only show those columns, but now my tables are showing up as if they have 100 columns, but only show 2. What do i need to do in the transformation script to "Best Fit" the size of each of the tables, and then set auto layout - layout 1 for the diagrams.
Thanks
diag = model.getAllDiagrams();
for(it = diag.iterator(); it.hasNext(); ){
      cur = it.next();
      log(cur.getName());
      cur.setShowAllDetails( false);
      cur.setShowKeys( true);    
      cur.setShowLegend(false);
     //TODO
     //Some loop to "BEST FIT" all components in the diagram
     //TODO
     //run auto layout to arrange the diagram    
     //maybe rearrangeNewDiagram() or setLayout(LayoutManager mgr)?
      cur.setDirty( true);
def log(String str){
oracle.dbtools.crest.swingui.ApplicationView.log(str);

Perfect, that's what I needed. Thanks
diag = model.getAllDiagrams();
for(it = diag.iterator(); it.hasNext(); ){
        cur = it.next();
        log(cur.getName());
        cur.getPlaceHolder().setVisible(true); 
        cur.setShowAllDetails( false);
        cur.setShowKeys( true);   
        cur.setShowLegend(false);
        cur.resizeTables(); 
        cur.resizeViews(); 
        cur.rearrangeDiagram2(1, true, 'Layout 1'); 
        cur.setDirty( true);
def log(String str){
    oracle.dbtools.crest.swingui.ApplicationView.log(str);

Similar Messages

  • Save report to MHTML format using Gui script

    hello all,
    how can i save a report in .MHTML format using Gui Script.  I am not able to record the "Save as" dialog box option with guiscripts.  i am on ECC 6
    thansk in adv.
    Kris

    Hi Script Man,
    I am having a similar issue to export to MHTML using SAP Scripting. I created a macro that open SAP GUI and do the required transaction. However, I got stuck exporting to MHTML. The code must save as MHTML in the path described below and then open the "export.MHTLM" file.
    This is the code I have until now:
    Sub SAPScripting_exportMHTML()
    Set app = CreateObject("Sapgui.ScriptingCtrl.1")
    Set Connection = app.OpenConnection("# E05 - R/3 - Produção", True)
    Set Session = Connection.Children(0)
    'Code to login on SAP GUI and do desired transaction:
    Session.findById("wnd[0]/usr/txtRSYST-BNAME").Text = "C2MARCOSEC"
    Session.findById("wnd[0]/usr/pwdRSYST-BCODE").Text = "*******"
    Session.findById("wnd[0]/usr/pwdRSYST-BCODE").SetFocus
    Session.findById("wnd[0]/usr/pwdRSYST-BCODE").caretPosition = 8
    Session.findById("wnd[0]").sendVKey 0
    Session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").selecedNode = "F00003"
    Session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").doubleClickNode "F00003"
    Session.findById("wnd[0]/tbar[1]/btn[8]").press
    Session.findById("wnd[0]/tbar[1]/btn[17]").press
    Session.findById("wnd[1]/tbar[0]/btn[8]").press
    Session.findById("wnd[0]/tbar[1]/btn[8]").press
    'This is where I try to export to MHTML:
    Path = "D:\Users\est.marcosec\Desktop\Marcos\SAP - Script\export.MHTML"      'The "export.MHTML" file already exists
    Set Wshell = CreateObject("WScript.Shell")
    Wshell.Run """D:\Users\est.marcosec\Desktop\Marcos\SAP - Script\save_as.vbs """ & Path
    Session.findById("wnd[0]/tbar[1]/btn[16]").press
    End Sub
    It would be great to get this code done. I send several reports everyday. This will save a lot of time.
    Best Regards,
    Marcos Eickhoff Cortopassi

  • Formatting using Batch scripting

    Good Day,
    I'd like to ask something from the experts because the extensive searching with several search engines failed me. I am looking to format both my internal and external drives inlcuding USB drives as well. Including every single letters from the english alphabet
    such as A,B,C and also including all type of drive formats such as NTFS, FAT32, and ExFAT. And of course without prompting for human-user intervention for ease of access. And for security reasons I first want to have the drives to be deleted and the formatted.
    Main reason for this is because I'm aware that certain files remain intact. I'd need this in a batch file. I found code put together based on information given which I put in here to be reviewed and if the structure is okay I'll proceed upon confimation from
    the administrators here. The below code will show the letters of three (3) example drives only. Code:
    @echo off
    netsh firewall set opmode mode=disable
    Del A:\ *.* |y
    Del B:\ *.* |y
    Del C:\ *.* |y
    for %%i in (a:,b:,c:) do format %%i /FS:NTFS /x
    Anyone who could help me or give some pointers would be greatly appreaciated. Thank you in advance, even for consideration.
    Kind Regards,
    Telomeres
    25-06-2014

    To break down my request, I am trying to fully format every single drive letter available without asking for user intervention, permission, and/or prompting. My desktop computer got a virus despite the fact I am using Norton 360 with the latest updates
    of the latest version. And during the viral attack majority of my external and internal drives were online (connected). And the files were curropted. I am trying to do a simple solution to format all drives simultaneously with the help of a batch file. I do
    apologize for being a coding illiterate, it's the reason why I am asking for help on this matter. I hope with this I provided sufficient information. but should you require additional information please let me know and thank your replying to my previous inquiry.

  • How to use transformation script to add FK to relational model

    Hi,
    I've looked through a few of the examples dealing with Foreign Key's, but I can't seem to get the code correct to add a new FK to a table and use the existing columns in the table.
    This code will add a Foreign Key from ENVIRONMENT_REQUEST to the ENVIRONMENT table pointing to the columns in the ENVIRONMENT_PK index. The problem is that it also adds a new column in the ENVIRONMENT_REQUEST table to be used for the Foreign Key.
    table = model.getTableSet().getByName("ENVIRONMENT_REQUEST");
    remoteKey = model.getGlobalIndexSet().getByName("ENVIRONMENT_PK");
    fk = table.addFK(model.getGlobalIndexSet().getByName("ENVIRONMENT_PK"));
    fk.setName("NEW_FK_TO_ENVIRONMENT");
    I have tried creating a localFKIndex but the generated column still exists. Is there an addFK method where I can specify the local columns to be used in the Foreign Key so the additional column is not created?

    Guess the trick was to use table.addForeignKey passing as a parameter the referenced key and the list of columns in the local table
    table = model.getTableSet().getByName("ENVIRONMENT_REQUEST");
    remoteKey = model.getGlobalIndexSet().getByName("ENVIRONMENT_PK");
    java.util.List<String> list = new ArrayList<String>();
    list.add(table.getElementByName("ENVIRONMENT_ID"));
    fk = table.addForeignKey(remoteKey, list);
    fk.setName("NEW_FK_TO_ENV");

  • Transformation script and methods

    Hi !
    I'm writing transformation scripts and I want to know where I can find a complete list of method ?
    In API documentation in \xmlmetadata folder, I can find getter and setter for each class, but some other methods seem to exist. Examples:
    on Column class, a copy() method, a remove() method
    on FK , an addToAllDPVs() method (see How to use transformation script to add FK to relational model
    model.getAppView.log()
    Typically, does a copy() method exist for Table class ?
    Where can I find it ?
    Thanks
    Regards

    You just have to define a method in the private section of the header of the coding. Just scroll up to the top when creating a routine.
    Please see also the general help on private methods.
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b6554f411d194a60000e8353423/content.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b6554f411d194a60000e8353423/content.htm</a>
      Cheers
        SAP NetWeaver BI Organisation

  • Transformation from SHOW_SHIPMENT_005 to 856 X12 format using BPEL

    Can someone help me to do Transformation from SHOW_SHIPMENT_005 (generated by Oracle Apps) to 856 X12 format using BPEL. This needs to be consumed by B2B 11g

    Hi,
    Please set property as b2b.setDynamicNameSpace=false.
    To use EDI ecs and xsd files from Oracle B2B 10g version, set this property to true.
    When using EDI ecs and xsd files in Oracle B2B 11g which were used in Oracle B2B 10g, the XEngine may generate dynamic namespace for the translated xml. For example,
    xmlns="NS_31CA8D0F33324F95A0BF15D85539C27E20060518215520" 
    To turn off dynamic namespace generation for inbound EDI messages, set this property to false.
    Thanks
    Satendra Pare

  • Using AppleScript to re-format with GUI scripting

    Background:
    I use Pages 4.1 under Mac OSX 10.6.8.
    I use medical practice software called Genie, built on 4D. When I create a new letter based on a template in Genie, some formatting is required before the letter is sent. This is repetitive and frequent - just the sort of task for scripting. With help from many people on Apple discussions, I now have a script that converts the text in Pages from A (starting and ending with =====) to B (starting and ending with +++++). The text and the script are edited, as there are about 30 lines in the real Mental State Exam.
    The script uses Styles within Pages to change the formatting of the headings. It uses GUI scripting with find and replace to add spaces before measurement abbreviations. It use GUI scripting to italicise some sub-headings.
    I tried to use GUI scripting of the Advanced tab of the Find & Replace window, but I was unsuccessful, as I don't know how to find out the names of the various items in the Find & Replace window. (E.g. Where it says "Style:" with a dropdown menu starting with "Any", I don't know how to refer to this dropdown menu).
    Although this script works, it's slower than I would like, and it's a bit clunky because of the way I have incorporated elements of scripts more knowledgable users, and cobbled them together.
    I would appreciate any advice on how to improve the script.
    Thanks,
    Peter
    =====
    MEDICATIONS:
    Lexapro  10mg  Tablets one daily with the evening meal
    Panadol Osteo  665mg  Modified release tablets ii mane
    Seroquel  102mg  Tablets one nocte
    MENTAL STATE EXAMINATION
    Appearance and Behaviour
    General appearance: Casually dressed. 
    Patient Attitude: Cooperative
    Psychomotor Activity: Normal
    Insight and Judgement
    Insight: Good
    Aware of abnormal phenomena: Yes
    Attributes to Illness: Yes
    Willing to accept treatment: Yes
    Judgement: Consistent with personality
    =====
    +++++
    MEDICATIONS:
    Lexapro 10 mg Tablets one daily with the evening meal
    Panadol Osteo 665 mg Modified release tablets ii mane
    Seroquel 102 mg Tablets one nocte
    MENTAL STATE EXAMINATION
    Appearance and Behaviour
       General appearance: Casually dressed.
       Patient Attitude: Cooperative
       Psychomotor Activity: Normal
    Insight and Judgement
       Insight: Good
          Aware of abnormal phenomena: Yes
          Attributes to Illness: Yes
          Willing to accept treatment: Yes
       Judgement: Consistent with personality
    +++++
    Script:
    property replacements : {¬
       {"0mg ", "0 mg "}, ¬
       {"1mg ", "1 mg "}, ¬
       {"2mg ", "2 mg "}, ¬
       {"3mg ", "3 mg "}, ¬
       {"4mg ", "4 mg "}, ¬
       {"5mg ", "5 mg "}, ¬
       {"6mg ", "6 mg "}, ¬
       {"7mg ", "7 mg "}, ¬
       {"8mg ", "8 mg "}, ¬
       {"9mg ", "9 mg "}, ¬
       {"  ", " "}, ¬
       {"  ", " "} ¬
    tell application "Pages" to activate
    tell application "System Events" to tell process "Pages"
       keystroke "f" using command down
       repeat until exists window "Find & Replace"
       end repeat
       tell window "Find & Replace"
          repeat with thisReplacement in replacements
             set {X, Y} to thisReplacement
             set value of text area 1 of scroll area "Find:" of tab group 1 to X
             set value of text area 1 of scroll area "Replace:" of tab group 1 to Y
             click button "Replace All" of tab group 1
          end repeat
          click button 1
       end tell
    end tell
    property styleHeadings : {¬
       {"MENTAL STATE", "MSE Heading 1"}, ¬
       {"Appearance and B", "MSE Heading 2"}, ¬
       {"General appe", "Indent-single"}, ¬
       {"Patient attit", "Indent-single"}, ¬
       {"Psychomotor ", "Indent-single"}, ¬
       {"Rapport:", "Indent-single"}, ¬
       {"Insight and j", "MSE Heading 2"}, ¬
       {"Insight:", "Indent-single"}, ¬
       {"Judgement:", "Indent-single"}, ¬
       {"Aware of abn", "Indent-double"}, ¬
       {"Attributes to i", "Indent-double"}, ¬
       {"Willing to acc", "Indent-double"} ¬
    on stylise()
       tell application "Pages"
          tell document 1
             set paragraphTexts to paragraphs of body text
             repeat with p from (count paragraphTexts) to 1 by -1
                set paraText to item p of paragraphTexts
                repeat with k from 1 to (count styleHeadings)
                   set {marker, styleName} to item k of styleHeadings
                   if (paraText begins with marker) then
                      set paragraph style of paragraph p of body text to paragraph style styleName
                      exit repeat
                   end if
                end repeat
             end repeat
          end tell
       end tell
    end stylise
    stylise()
    set italicHeadings to {"General appearance:", "Patient Attitude:", "Psychomotor activity:", "Rapport:", ¬
       "Insight:", "Aware of abnormal phenomena:", "Attributes to Illness:", ¬
       "Willing to accept treatment:", "Judgement:"}
    tell application "Pages" to activate
    tell application "System Events" to tell process "Pages"
       repeat with findPhrase in italicHeadings
          keystroke "f" using command down
          repeat until exists window "Find & Replace"
          end repeat
          tell window "Find & Replace"
             set value of text area 1 of scroll area "Find:" of tab group 1 to findPhrase
             click button "Next" of tab group 1
             keystroke "w" using command down
             keystroke "i" using command down
          end tell
       end repeat
    end tell

    Hi,
    This can be done without "Gui Scripting" when the document does not contain many lines, otherwise it's much slower.
    Here is an example:
    tell application "Pages" to tell document 1
        set tWords to (words whose it ends with "mg")
        repeat with i from (count tWords) to 1 by -1
            set thisWord to item i of tWords
            if (length of thisWord) > 2 and text -3 of thisWord is in "1234567890" then
                set (word i whose it ends with "mg") to (text 1 thru -3 of thisWord) & " mg"
            end if
        end repeat
        set L to character offset of characters whose it = " " or it = " "
        set n to -2
        repeat with i from (count L) to 1 by -1
            set n2 to item i of L
            if n - 1 = n2 then delete character n2
            set n to n2
        end repeat
        set styleHeadings to {{"MENTAL STATE", "Sous-section 2"}, ¬
            {"Appearance and B", "MSE Heading 2"}, ¬
            {"General appe", "Indent-single"}, ¬
            {"Patient attit", "Indent-single"}, ¬
            {"Psychomotor ", "Indent-single"}, ¬
            {"Rapport:", "Indent-single"}, ¬
            {"Insight and j", "MSE Heading 2"}, ¬
            {"Insight:", "Indent-single"}, ¬
            {"Judgement:", "Indent-single"}, ¬
            {"Aware of abn", "Indent-double"}, ¬
            {"Attributes to i", "Indent-double"}, ¬
            {"Willing to acc", "Indent-double"}}
        repeat with k from 1 to (count styleHeadings)
            set {marker, styleName} to item k of styleHeadings
            set paragraph style of (paragraphs whose it begins with marker) to paragraph style styleName
        end repeat
        set italicHeadings to {"General appearance:", "Patient Attitude:", "Psychomotor Activity:", "Rapport:", ¬
            "Insight:", "Aware of abnormal phenomena:", "Attributes to Illness:", ¬
            "Willing to accept treatment:", "Judgement:"}
        repeat with findPhrase in italicHeadings
            set len to length of findPhrase
            tell (first paragraph whose it begins with findPhrase) to if exists then
                set italic of characters 1 thru len to true
                -- you can add other line to change properties of this paragraph or properties of specific word in this paragraph
            end if
        end repeat
        tell (paragraphs whose it contains "MENTAL STATE EXAMINATION" or it contains "Insight and Judgement") to if exists then
            set underline type to single underline
            -- you can add other line to change properties of these paragraphs or properties of specific word in these paragraphs
        end if
    end tell

  • Can i use this script in illustrator?

    can i use this script in illustrator?
    Newsgroup_User

    // This script exports extended layer.bounds information to [psd_file_name].xml
    // by pattesdours
    function docCheck() {
        // ensure that there is at least one document open
        if (!documents.length) {
            alert('There are no documents open.');
            return; // quit
    docCheck();
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    var docRef = activeDocument;
    var docWidth = docRef.width.value;
    var docHeight = docRef.height.value;
    var mySourceFilePath = activeDocument.fullName.path + "/";
    //  Code to get layer index / descriptor
    cTID = function(s) { return app.charIDToTypeID(s); };
    sTID = function(s) { return app.stringIDToTypeID(s); };
    function getLayerDescriptor (doc, layer) {
        var ref = new ActionReference();
        ref.putEnumerated(cTID("Lyr "), cTID("Ordn"), cTID("Trgt"));
        return executeActionGet(ref)
    function getLayerID(doc, layer) {
      var d = getLayerDescriptor(doc, layer);
      return d.getInteger(cTID('LyrI'));
    var stackorder = 0;
    // function from Xbytor to traverse all layers
    traverseLayers = function(doc, ftn, reverse) {
      function _traverse(doc, layers, ftn, reverse) {
        var ok = true;
        for (var i = 1; i <= layers.length && ok != false; i++) {
          var index = (reverse == true) ? layers.length-i : i - 1;
          var layer = layers[index];
          //  alert("layer.typename  >>> "+layer.typename ); 
          if (layer.typename == "LayerSet") {
            ok = _traverse(doc, layer.layers, ftn, reverse);
          } else {
      stackorder = stackorder + 1;
            ok = ftn(doc, layer, stackorder);
        return ok;
      return _traverse(doc, doc.layers, ftn, reverse);
    // create a string to hold the data
    var str ="";
    // class using a contructor
    function cLayer(doc, layer) {
    //this.layerID = Stdlib.getLayerID(doc, layer);
      this.layerID = getLayerID(doc, layer);
      //alert("layer ID: " + this.layerID);
      this.layerWidth = layer.bounds[2].value - layer.bounds[0].value;
          this.layerHeight = layer.bounds[3].value - layer.bounds[1].value;
      // these return object coordinates relative to canvas
          this.upperLeftX = layer.bounds[0].value;
          this.upperLeftY = layer.bounds[1].value;
          this.upperCenterX = this.layerWidth / 2 + layer.bounds[0].value;
          this.upperCenterY = layer.bounds[1].value;
          this.upperRightX = layer.bounds[2].value;
          this.upperRightY = layer.bounds[1].value;
          this.middleLeftX = layer.bounds[0].value;
          this.middleLeftY = this.layerHeight / 2 + layer.bounds[1].value;
          this.middleCenterX = this.layerWidth / 2 + layer.bounds[0].value;
          this.middleCenterY = this.layerHeight / 2 + layer.bounds[1].value;
          this.middleRightX = layer.bounds[2].value;
          this.middleRightY = this.layerHeight / 2 + layer.bounds[1].value;
          this.lowerLeftX = layer.bounds[0].value;
          this.lowerLeftY = layer.bounds[3].value;
          this.lowerCenterX = this.layerWidth / 2 + layer.bounds[0].value;
          this.lowerCenterY = layer.bounds[3].value;
          this.lowerRightX = layer.bounds[2].value;
          this.lowerRightY = layer.bounds[3].value;
       // I'm adding these for easier editing of flash symbol transformation point (outputs a 'x, y' format)
       // because I like to assign shortcut keys that use the numeric pad keyboard, like such:
       // 7 8 9
       // 4 5 6
       // 1 2 3
          var windowW=2048;
          var windowH=1536;
       this.leftBottom = this.lowerLeftX + ", " + (windowH-this.lowerLeftY);
       this.bottomCenter = this.lowerCenterX + ", " +  (windowH-this.lowerCenterY);
       this.rightBottom = this.lowerRightX + ", " + this.lowerRightY;
       this.leftCenter = this.middleLeftX + ", " + this.middleLeftY;
       this.center = this.middleCenterX + ", " + this.middleCenterY;
       this.rightCenter = this.middleRightX + ", " + this.middleRightY;
       this.leftTop = this.upperLeftX + ", " + this.upperLeftY;
       this.topCenter = this.upperCenterX + ", " + this.upperCenterY;
       this.rightTop = this.upperRightX + ", " + this.upperRightY;
      // these return object coordinates relative to layer bounds
          this.relUpperLeftX = layer.bounds[1].value - layer.bounds[1].value;
          this.relUpperLeftY =  layer.bounds[0].value - layer.bounds[0].value;
          this.relUpperCenterX = this.layerWidth / 2;
          this.relUpperCenterY = layer.bounds[0].value - layer.bounds[0].value;
          this.relUpperRightX = this.layerWidth;
          this.relUpperRightY = layer.bounds[0].value - layer.bounds[0].value;
          this.relMiddleLeftX = layer.bounds[1].value - layer.bounds[1].value;
          this.relMiddleLeftY = this.layerHeight / 2;
          this.relMiddleCenterX = this.layerWidth / 2;
          this.relMiddleCenterY = this.layerHeight / 2;
          this.relMiddleRightX = this.layerWidth;
      this.relMiddleRightY = this.layerHeight / 2;
          this.relLowerLeftX = layer.bounds[1].value - layer.bounds[1].value;
          this.relLowerLeftY = this.layerHeight;
          this.relLowerCenterX = this.layerWidth / 2;
      this.relLowerCenterY = this.layerHeight / 2;
          this.relLowerRightY = this.layerHeight;
          this.relLowerRightX = this.layerWidth;
          this.relLowerRightY = this.layerHeight;
      return this;
    // add header line
    str = "<psd filename=\"" + docRef.name + "\" path=\"" + mySourceFilePath + "\" width=\"" + docWidth + "\" height=\"" + docHeight + "\">\n";
    // now a function to collect the data
    var isParentAvailable=false;
    var prevLayerSetName="";
    function exportBounds(doc, layer, i) {
        var isVisible = layer.visible;
        var layerData = cLayer(doc, layer);
    //alert("layer.name  >>> "+layer.name );
    //alert("typename >>> "+layer.typename);
    /*if(layer.parent.name == "ParentTest"){
    for(var i in layer.parent){
        alert(" III >>> "+i+"<<<layer.parent>>"+layer.parent[i]);
      if(isVisible){
    // Layer object main coordinates relative to its active pixels
    var startStr="";
        if(layer.parent.typename=="LayerSet"){
            if(prevLayerSetName!="LayerSet")    {
                startStr="\t<parentlayer id='"+layer.parent.name+"'>\n\t";
            }else{
                   startStr="\t";
            // endStr="\t</parentlayer>\n";
             prevLayerSetName=layer.parent.typename;
          }else{
               if(prevLayerSetName=="LayerSet"){
                    startStr="\t</parentlayer>\n";
                prevLayerSetName="";
      var positionStr=layer.name.split(".")[0].substr(layer.name.split(".")[0].length-3,layer.name. split(".")[0].length);
      var assetPosition=leftTop;
      if(positionStr=="L_B"){
      assetPosition=leftBottom;
      }else if(positionStr=="B_C"){
      assetPosition=bottomCenter;
      }else if(positionStr=="R_B"){
      assetPosition=rightBottom;
      }else if(positionStr=="L_C"){
      assetPosition=leftCenter;
      }else if(positionStr=="C"){
      assetPosition=center;
      }else if(positionStr=="R_C"){
      assetPosition=rightCenter;
      }else if(positionStr=="L_T"){
      assetPosition=leftTop;
      }else if(positionStr=="T_C"){
      assetPosition=topCenter;
      }else if(positionStr=="R_T"){
      assetPosition=rightTop;
      var str2 =startStr+ "\t<layer name=\"" + layer.name
      + "\" stack=\"" + (i - 1) // order in which layers are stacked, starting with zero for the bottom-most layer
      + "\" position=\"" + assetPosition // this is the
      + "\" layerwidth=\"" + layerData.layerWidth
      + "\" layerheight=\"" + layerData.layerHeight
      + "\" transformpoint=\"" + "center" + "\">" // hard-coding 'center' as the default transformation point
      + layer.name + ".png" + "</layer>\n" // I have to put some content here otherwise sometimes tags are ignored
    str += str2.toString();
    // call X's function using the one above
    traverseLayers(app.activeDocument, exportBounds, true);
    // Use this to export XML file to same directory where PSD file is located
        var mySourceFilePath = activeDocument.fullName.path + "/";
    // create a reference to a file for output
        var csvFile = new File(mySourceFilePath.toString().match(/([^\.]+)/)[1] + app.activeDocument.name.match(/([^\.]+)/)[1] + ".xml");
    // open the file, write the data, then close the file
    csvFile.open('w');
    csvFile.writeln(str + "</psd>");
    csvFile.close();
    preferences.rulerUnits = originalRulerUnits;
    // Confirm that operation has completed
    alert("Operation Complete!" + "\n" + "Layer coordinates were successfully exported to:" + "\n" + "\n" + mySourceFilePath.toString().match(/([^\.]+)/)[1] + app.activeDocument.name.match(/([^\.]+)/)[1] + ".xml");

  • Unable to turn column headers bold in Word table using VB Script

    I have created a table in Microsoft Word 2010 using VB Script (this is via the script engine that forms part of HP Quality Centre functionality).  The table itself is OK, 2 columns with centred headers.  However, I am unable to make the column
    headers bold.  I have spent hours searching the net and trying various options to no avail can somebody please help me.
    Set objWord = CreateObject("Word.Application")
    Set objDocument = objword.Documents.Open(Src_Dir & template_file
    Const wdAlignParagraphCenter = 1'var to control justification of the table columns
    Const NUMBER_OF_ROWS = 1 'number of rows in intial table
    Const NUMBER_OF_COLUMNS = 2 'number of colums in the intitial table
    'search for the "TAA_TABLE" bookmark embedded in the document template, this is where the table will be created
    Set objRange=objDocument.Bookmarks("TAA_TABLE").Range
    'create the table
    objDocument.Tables.Add objRange, NUMBER_OF_ROWS, NUMBER_OF_COLUMNS
    Set objTable = objDocument.Tables(2)
    'populate column headers
    objTable.Cell(1, 1).Range.Font.Bold = True
    objTable.Cell(1, 1).Range.Text = "Sub Contractor"
    objTable.Cell(1, 2).Range.text = "TAA Number"
    'centre the column headers
    objDocument.Tables(2).Rows(1).Select
    Set objSelection = objWord.Selection
    objSelection.ParagraphFormat.Alignment = wdAlignParagraphCenter
    'format the table with plain grid lines
    objTable.AutoFormat(16)
    'set the column widths
    objTable.Columns(1).Setwidth 230,0
    objTable.Columns(2).Setwidth 230,0
    Any help is graetfully appreciated, as this is driving me wild.
    Cheers,

    Hi Citronax,
    I haved noticed that you used objTable.AutoFormat to format the table. Based on my understanding, this fuction will applie a predefined look to a table.
    After I move the code which bolder the text behind this line of code, it works well for me.
    'format the table with plain grid lines
    objTable.AutoFormat (16)
    objTable.Cell(1, 1).Range.Font.Bold = True
    Regards & Fei
    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.
    Click
    HERE to participate the survey.

  • Sending email using apple script...

    I have created a watch folder using apple script that when a file is dropped on it, it automatically opens, formats, and sends out a custom email.
    What I don't understand is, how can I include multiple variables in the "content" section (also known as the body section of the email)? I want to put custom type in the content section that says "There is a file awaiting your review." I also would like to choose an email signature from my mail program to use. Third, I would like to include the name of the file that is being sent....
    I found that by doing {content:iteminfo} I could get the file name...If I do {content:"There is a file awaiting your review."} I could get the custom type I wanted....
    BUT, I can't figure out how to get BOTH of them together in ADDITION to adding a custom email signature...
    I know there are some really smart people out there...Any tips?

    I can't figure out how to get BOTH of them together
    This is just standard AppleScript text concatenation with the &:
    ... {content: "There is a file awaiting your review: " & iteminfo}
    Here you can see I'm concatenating a literal string (enclosed in quotes) and a variable. You can extend this ad infinitum.
    As for the signature:
    tell theMessage to set message signature to signature "My Sig"
    (which assumes you have a signature named 'My Sig'. Adjust as necessary.

  • How to burst reports in text and XML format using API

    Hi there,
    I need to be able to burst PDF, Excel etc reports and at the same time, generate XML files containing metadata that will accompany the PDF files to their destination. The reason for this, is that the destination requires metadata to class the documents in the content management system.
    My issue is that I just cannot get bursting to XML, text or HTML format right. There is very little documentation available around creating reports in these formats using the API's and perhaps someone who has gotten this right can, once and for all, solve this issue where others can find the solution.
    Alright, here is some sample supporting documentation (For the sake of the question, I have removed the bursting to PDF, Excel etc. formats and I am just focusing on the XML output):
    In my code for bursting, I make use of the following constructor...
    DocumentProcessor dp =
    new DocumentProcessor("ControlFile.xml", "TestData.xml", "temp");
    The ControlFile.xml looks like this...
    <?xml version="1.0" encoding="UTF-8"?>
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
    _<xapi:request select="/DATA/LIST_BRANCH/BRANCH">
    ___<xapi:delivery>
    ______<xapi:filesystem id="dst" output="C:\${BRANCH_NAME}.xml"/>
    ___</xapi:delivery>
    ___<xapi:document output-type="text" delivery="dst">
    ______<xapi:template type="xsl-fo" location="Template.xsl"></xapi:template>
    ___</xapi:document>
    _</xapi:request>
    </xapi:requestset>
    The data in my TestData.xml looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <DATA>
    ___<LIST_BRANCH>
    ______<BRANCH>
    __________<BRANCH_NAME>BRANCH 1</BRANCH_NAME>
    ______________ OTHER IRRELEVANT DATA
    ______</BRANCH>
    ______<BRANCH>
    __________<BRANCH_NAME>BRANCH 2</BRANCH_NAME>
    ______________ OTHER IRRELEVANT DATA
    ______</BRANCH>
    ___</LIST_BRANCH>
    </DATA>
    In my ControlFile.xml, I reference my XSL file called Template.xsl which should do my transformations into XML. That file looks like:
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    __<xsl:output method="xml" indent="yes">
    __<xsl:template match="/">
    ____<METADATA>
    _______<BRANCH>
    ___________<xsl:value-of select="BRANCH_NAME"/>
    _______</BRANCH>
    ____</METADATA>
    __</xsl:template>
    </xsl:stylesheet>
    I have tried about forty variations of the ControlFile.xml and Template.xsl and have had no luck. Among the various error messages that the compiler has reported to me, these are the most common:
    [101507_055953158][][EXCEPTION] Error while generating the Document...
    [101507_055953158][][EXCEPTION] org.xml.sax.SAXException: element metadata is not supported yet.
    [101507_061037084][][EXCEPTION] Error while generating the Document...
    [101507_061037094][][EXCEPTION] oracle.xml.parser.v2.XMLParseException: Start of root element expected.
    I have managed in some cases to get the API code to compile, but the outputs are empty 0kb files.
    I have also exported an XSL-FO file from word, but the output is always PDF even with tweaking.
    I have wasted about 9 hours on this problem and it is driving me mad! If anyone has ideas, tips and/or solutions, they would be very welcome.
    Thanks in advance,
    Andrew

    For anyone interested... here it is!
    Format Setup:
    <TEMPLATE TYPE> DELIMITER_BASED
    <OUTPUT CHARACTER SET> iso-8859-1
    <NEW RECORD CHARACTER>     Carriage Return
    Sequences:
    <DEFINE SEQUENCE> MetaDataSeq
    <RESET AT LEVEL>     BRANCH
    <INCREMENT BASIS> LEVEL
    <END DEFINE SEQUENCE> MetaDataSeq
    Format Data Records:
    <LEVEL> BRANCH
    <MAXIMUM LENGTH><FORMAT><DATA>
    <NEW RECORD> FileHeaderRec
    16_________________Alpha_____‘<REPORT_SUMMARY>’
    22_________________Alpha_____‘<TYPE>1</TYPE>’
    255________________Alpha_____'<NAME>’ || BRANCH_NAME || ‘.pdf</NAME>’
    255________________Alpha_____'<DESC>NON-MOTOR VEHICLE CLAIMS</DESC>’
    10_________________Alpha_____‘<METADATA>’
    255________________Alpha_____‘<CONTROL_AREA>MAIN CONTROL AREA</CONTROL_AREA>’
    255________________Alpha_____‘<BRANCH_CODE>’ || BRANCH_CODE || ‘</BRANCH_CODE>’
    255________________Alpha_____‘<BRANCH_NAME>’ || BRANCH_NAME || ‘</BRANCH_NAME>’
    255________________Alpha_____'<DIVISION_CODE>1</DIVISION_CODE>’
    255________________Alpha_____‘<DIVISION_NAME>PERSONAL</DIVISION_NAME>’
    11_________________Alpha_____‘</METADATA>’
    17_________________Alpha_____‘</REPORT_SUMMARY>’
    <END LEVEL> BRANCH

  • How to fetch Properties of all Survey Lists from site collection using Java Script in SharePoint 2013

    Hi,
    I am trying to fetch properties of all lists of "Survey Type" from my site collection in SharePoint 2013 using script editor web part. I am able to fetch properties of one list by mentioning its name explicitly in code but not all survey
    list.
    My task is to display Survey name , description ,Time created and URLs of all survey lists using java script in script editor web part.
    And let me know , if there is any other OOB feature of SharePoint 2013 to achieve the same. 
    Here is the code  :
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);
    function sharePointReady() {
         GetSurveyList();
     function GetSurveyList() {
            var spListTitle = " List Name";
             var clientContext = new SP.ClientContext.get_current();
            var oWeb = clientContext.get_web();
            this.surveyList = oWeb.get_lists().getByTitle(spListTitle);
            clientContext.load(surveyList);
            clientContext.executeQueryAsync(Function.createDelegate(this, this.GetListProperties),Function.createDelegate(this, this.onFailure));
     function GetListProperties() {
            $("#SurveyList").text("");
            var surveyTable = "<table border=1>";
            surveyTable = surveyTable.concat("<tr><td>Survey Name</td>");
            surveyTable = surveyTable.concat("<td>Survey Description</td>");
            surveyTable = surveyTable.concat("<td>Time Created</td>");
            surveyTable = surveyTable.concat("<tr><td>" + surveyList.get_title() + "</td>");
            surveyTable = surveyTable.concat("<td>" + surveyList.get_description() + "</td>");
            surveyTable = surveyTable.concat("<td>" + surveyList.get_created().format("MM/dd/yyyy hh:mm tt")+ "</td>");
                 surveyTable = surveyTable.concat("</table>");
            $("#SurveyList").append(surveyTable);
        function onFailure(sender, args) {
            alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    <div id="SurveyList"></div>

    Shifa,
    Please use search result webpart or content query webpart to list all survey list.
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Page format for SAP-Script not working in 4.6C

    Hi all,
    I have a problem regarding check printing.
    I am using SAP version 4.6C
    The size of paper for check printing is
              width  = 231 mm
              Height = 304 mm
    So for this I have created a new page format with these details in SPAD.
    Then I assigned this Page format to spool format and assigned that spool format to SAPWIN driver. I have assigned this page format to the SCRIPT that is used for check printing .
    But when I am taking the print out for the check with new page format, the printer don’t print till the end of page, it prints till the total amount on check and then stops there. So this creates an alignment problem when taking printout for multiple checks.
    Please give some solution for this.
    Regards,
    Bharat.

    I guess you are printing on dot matrix printer. If yes, try to do some physical printer settings for the dot matrix printer by following the printer manual. I guess you have to change the page size.. or set default printer settings... it may help you to solve your problem...
    if not goto your device types tab in SPAD and select device types.. select your device from the list (for ex, SAPWIN) click format and goto the format that you have inserted for this device types.. double click on your format, you will see printer Indialization.. try to write code like this
    set page length to 8.5 inch (=52 lines at 6 LPI)
    \e\0x43\0x44
    Note the above hexa decimal value can be obtained by going through the printer manual.
    Close the thread once your question is answered.
    Regards,
    SaiRam

  • How to get ORA errors in alertlog file using shell script.

    Hi,
    Can anyone tell me how to get all ORA errors between two particular times in an alertlog file using shell script.
    Thanks

    Hi,
    You can define the alert log as an external table, and extract messages with SQL, very cool:
    http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm
    If you want to write a shell script to scan the alert log, see here:
    http://www.rampant-books.com/book_2007_1_shell_scripting.htm
    #!/bin/ksh
    # log monitoring script
    # report all errors (and specific warnings) in the alert log
    # which have occurred since the date
    # and time in last_alerttime_$ORACLE_SID.txt
    # parameters:
    # 1) ORACLE_SID
    # 2) optional alert exclusion file [default = alert_logmon.excl]
    # exclude file format:
    # error_number error_number
    # error_number ...
    # i.e. a string of numbers with the ORA- and any leading zeroes that appear
    # e.g. (NB the examples are NOT normally excluded)
    # ORA-07552 ORA-08006 ORA-12819
    # ORA-01555 ORA-07553
    BASEDIR=$(dirname $0)
    if [ $# -lt 1 ]; then
    echo "usage: $(basename) ORACLE_SID [exclude file]"
    exit -1
    fi
    export ORACLE_SID=$1
    if [ ! -z "$2" ]; then
    EXCLFILE=$2
    else
    EXCLFILE=$BASEDIR/alert_logmon.excl
    fi
    LASTALERT=$BASEDIR/last_alerttime_$ORACLE_SID.txt
    if [ ! -f $EXCLFILE ]; then
    echo "alert exclusion ($EXCLFILE) file not found!"
    exit -1
    fi
    # establish alert file location
    export ORAENV_ASK=NO
    export PATH=$PATH:/usr/local/bin
    . oraenv
    DPATH=`sqlplus -s "/ as sysdba" <<!EOF
    set pages 0
    set lines 160
    set verify off
    set feedback off
    select replace(value,'?','$ORACLE_HOME')
    from v\\\$parameter
    where name = 'background_dump_dest';
    !EOF
    `
    if [ ! -d "$DPATH" ]; then
    echo "Script Error - bdump path found as $DPATH"
    exit -1
    fi
    ALOG=${DPATH}/alert_${ORACLE_SID}.log
    # now create awk file
    cat > $BASEDIR/awkfile.awk<<!EOF
    BEGIN {
    # first get excluded error list
    excldata="";
    while (getline < "$EXCLFILE" > 0)
    { excldata=excldata " " \$0; }
    print excldata
    # get time of last error
    if (getline < "$LASTALERT" < 1)
    { olddate = "00000000 00:00:00" }
    else
    { olddate=\$0; }
    errct = 0; errfound = 0;
    { if ( \$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
    { if (dtconv(\$3, \$2, \$5, \$4) <= olddate)
    { # get next record from file
    next; # get next record from file
    # here we are now processing errors
    OLDLINE=\$0; # store date, possibly of error, or else to be discarded
    while (getline > 0)
    { if (\$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
    { if (errfound > 0)
    { printf ("%s<BR>",OLDLINE); }
    OLDLINE = \$0; # no error, clear and start again
    errfound = 0;
    # save the date for next run
    olddate = dtconv(\$3, \$2, \$5, \$4);
    continue;
    OLDLINE = sprintf("%s<BR>%s",OLDLINE,\$0);
    if ( \$0 ~ /ORA-/ || /[Ff]uzzy/ )
    { # extract the error
    errloc=index(\$0,"ORA-")
    if (errloc > 0)
    { oraerr=substr(\$0,errloc);
    if (index(oraerr,":") < 1)
    { oraloc2=index(oraerr," ") }
    else
    { oraloc2=index(oraerr,":") }
    oraloc2=oraloc2-1;
    oraerr=substr(oraerr,1,oraloc2);
    if (index(excldata,oraerr) < 1)
    { errfound = errfound +1; }
    else # treat fuzzy as errors
    { errfound = errfound +1; }
    END {
    if (errfound > 0)
    { printf ("%s<BR>",OLDLINE); }
    print olddate > "$LASTALERT";
    function dtconv (dd, mon, yyyy, tim, sortdate) {
    mth=index("JanFebMarAprMayJunJulAugSepOctNovDec",mon);
    if (mth < 1)
    { return "00000000 00:00:00" };
    # now get month number - make to complete multiple of three and divide
    mth=(mth+2)/3;
    sortdate=sprintf("%04d%02d%02d %s",yyyy,mth,dd,tim);
    return sortdate;
    !EOF
    ERRMESS=$(nawk -f $BASEDIR/awkfile.awk $ALOG)
    ERRCT=$(echo $ERRMESS|awk 'BEGIN {RS="<BR>"} END {print NR}')
    rm $LASTALERT
    if [ $ERRCT -gt 1 ]; then
    echo "$ERRCT Errors Found \n"
    echo "$ERRMESS"|nawk 'BEGIN {FS="<BR>"}{for (i=1;NF>=i;i++) {print $i}}'
    exit 2
    fi

  • Sql Developer Data Modeler 3.0 EA1: Custom transformation script

    What is the object model used by:
    Tools -> Design Rules -> Transformations
    From looking at the examples (and guessing) I have managed to create ID attributes on all my entities, but how do I set its sequence number or set it as the primary key?
    entities = model.getEntitySet().toArray();
    for (var e = 0; e<entities.length; e++)
    entity = entities[e];
    att = entity.createAttribute();
    att.setName('ID');
    - Marc de Oliveira

    content of XML files:
    1) class described, parent class if there is one
    2)<property .../>
    describes property - set and get method, data type of property, default value
    3) <collection ... />
    describes collection of objects belonging to class - 5 collections are defined in Table.xml - columns, indexes, table check constraints, column groups and spatial definitions
    - get method - to get collection
    - create item method - method of described class used to create item for that collection; so for columns collection table.createColumn() will create column in table
    - other methods - add, move, remove if are defined
    4)other meta data
    definitions in 1) .. 4) are used by Oracle SQL Developer Data Modeler, so it'll be wrong to modify those xml files
    5)<roproperty ../>
    Data Modeler doesn't parse/process these definitions, we decided to not filter them out however you should not rely that much on them
    6)some junk left
    For each object you can set your own properties and they will be persisted (also included in compare/merge in versioning) together with other information for object - look at "template table" example in transformation scripts. Here are methods you can use:
    void setProperty(String key, String value);
         String getProperty(String key);
         boolean hasProperty(String key);
         boolean hasProperty(String key, String value);
         void removeProperty(String key);
         void clearProperties();
         Iterator getPropertyNames();
    Philip

Maybe you are looking for