Scripts need help

hi
in scripts in one window i have to fill with first day of current system year and last day of system current year . how to get it ?
thanks& regards
lakshmi

Hi,
Try this function module 'FIRST_AND_LAST_DAY_IN_YEAR_GET'
Thanks
Vasudha

Similar Messages

  • Indesign CS5.5 Relink Script needs help

    Hi, I'm trying to relink images in an InDesign CS5.5 file to a different server using a script. This is what I have so far, but when I run the script I get errors and can't relink because "Either the file does not exist, you do not have permission, or the file may be in use by another application". Does anyone know how to make this script work? I'm fairly new to scripting.
    Here is the script I have:
    tell application "Adobe InDesign CS5.5"
              tell document 1
                        set linkList to links
                        set errInfo to "" -- We'll display error if we can't relink an item
                        repeat with x in linkList
                                  if (x's status) is not normal then -- I usually check for any link that has an error
      -- This should only return an AppleScript path with ":" separators
                                            set linkPath to (x's file path) as string
                                            if "Volumes/Calendars_2013 FPO" is in linkPath then
                                                      set AppleScript's text item delimiters to "Volumes/Calendars_2013 FPO"
                                                      set linkPath to (linkPath's text items) -- Create a list of text items
                                                      set AppleScript's text item delimiters to "Volumes/Calendars_2013"
                                                      set linkPath to (linkPath as string) -- Concatenate with new path
                                                      set AppleScript's text item delimiters to "" -- Reset TIDs
                                                      try
      -- Need to make our string (path) into an alias path
      relink x to alias linkPath
                                                                try
      update x -- This can be helpful
                                                                end try
                                                      on error err
      -- We'll store link name if error occurs
                                                                set errInfo to (errInfo & return & x's name)
                                                      end try
                                            end if
                                  end if
                        end repeat
      -- If an error occurs while trying to relink, we'll display it
                        if (count errInfo) > 0 then display dialog ("Can't relink:" & errInfo)
              end tell
    end tell
    --Hector

    I just tried adding collens to the end of the folder path. For some reason the script skipped the relink line. Below is the code with your update. I'm thinking its not finding the images because the script needs to make a list of all the images and choose the one that matches the missing image.
    tell application "Adobe InDesign CS5.5"
              tell document 1
                        set linkList to links
                        set errInfo to "" -- We'll display error if we can't relink an item
                        repeat with x in linkList
                                  if (x's status) is not normal then -- I usually check for any link that has an error
      -- This should only return an AppleScript path with ":" separators
                                            set linkPath to (x's file path) as string
                                            if "Calendars_2013 FPO:" is in linkPath then
                                                      set AppleScript's text item delimiters to "Calendars_2013 FPO:"
                                                      set linkPath to (linkPath's text items) -- Create a list of text items
                                                      set AppleScript's text item delimiters to "Calendars_2013:"
                                                      set linkPath to (linkPath as string) -- Concatenate with new path
                                                      set AppleScript's text item delimiters to "" -- Reset TIDs
                                                      try
      -- Need to make our string (path) into an alias path
      relink x to alias linkPath
                                                                try
      update x -- This can be helpful
                                                                end try
                                                      on error err
      -- We'll store link name if error occurs
                                                                set errInfo to (errInfo & return & x's name)
                                                      end try
                                            end if
                                  end if
                        end repeat
      -- If an error occurs while trying to relink, we'll display it
                        if (count errInfo) > 0 then display dialog ("Can't relink:" & errInfo)
              end tell
    end tell
    --Thanks for you help

  • OMB Script: Need help to spot what's wrong

    I have been trying to find out why the outer foreach loop in the following OMB script (log follows) doesn't go to the next iteration. It just exits after getting the lineage for the first target table (i.e., stderr has nothing). Same behavior against different modules. I am too new to Tcl to know what debugging tool is at my disposal. Any help will be appreciated:
    set OMBLOG c:/temp/Lineage.tcl.log
    # connect to the OWB repository
    OMBCONNECT xxx/xxx@xxx:1521:xxx USE REPOSITORY 'OWB_REP_OWN';
    # change context to the module
    OMBCC 'xxx/xxx/xxx';
    set tableList {}
    set tableList [OMBLIST TABLES '.*_FINAL']
    set i 1
    foreach tableName $tableList {
    set columnList {}
    set columnList [OMBRETRIEVE TABLE '$tableName' GET COLUMNS]
    set j 1
    foreach columnName $columnList {
    OMBLINEAGE DEPENDENCYTYPE 'DATAFLOW' TABLE '$tableName' COLUMN '$columnName';
    incr j
    incr i
    OMBDISCONNECT;
    The first few lines on the log are:
    OMBLIST TABLES '.*_FINAL'
    AE_FINAL CM_FINAL CO_FINAL DA_FINAL DM_FINAL DP_FINAL DS_FINAL DV_FINAL EG_FINAL EX_FINAL IE_FINAL LB_FINAL LS_FINAL MH_FINAL ML_FINAL PC_FINAL PE_FINAL PP_FINAL PR_FINAL QS_FINAL RELREC_FINAL RS_FINAL SC_FINAL SG_FINAL SS_FINAL SUPPAE_FINAL SUPPDS_FINAL SUPPMH_FINAL SUPPPE_FINAL SUPPQUAL_FINAL SU_FINAL VS_FINAL
    OMBRETRIEVE TABLE 'AE_FINAL' GET COLUMNS
    STUDYID DOMAIN USUBJID AESEQ AEGRPID AEREFID AESPID AETERM AEMODIFY AEDECOD AECAT AESCAT AEOCCUR AEBODSYS AELOC AESEV AESER AEACN AEACNOTH AEREL AERELNST AEPATT AEOUT AESCAN AESCONG AESDISAB AESDTH AESHOSP AESLIFE AESOD AESMIE AECONTRT AETOXGR AESTDTC AEENDTC AESTDY AEENDY AEDUR AEENRF VISITNUM VISIT OCTA_SEQ
    OMBLINEAGE DEPENDENCYTYPE 'DATAFLOW' TABLE 'AE_FINAL' COLUMN 'STUDYID'
    {{COLUMN /xxx/xxx_C0402_DEV/AE_AE_INTERIM/STUDYID} {MAPPING /xxx/xxx_C0402_DEV/AE_FINAL_MAP} {COLUMN /xxx/xxx_C0402_DEV/AE_FINAL/STUDYID}} {{ATTRIBUTE /xxx/AE_AE_PM/PROT} {MAPPING /xxx/xxx_C0402_DEV/AE_INTERIM_MAP} {COLUMN /xxx/xxx_C0402_DEV/AE_AE_INTERIM/STUDYID}} {{COLUMN /xxx/xxx_C0402_DEV/AE_SOURCE/PROT} {MAPPING /xxx/xxx_C0402_DEV/AE_INTERIM_MAP} {COLUMN /xxx/xxx_C0402_DEV/AE_AE_INTERIM/STUDYID}} {{ATTRIBUTE /xxx/AE_AE_PM/PROT} {MAPPING /xxx/xxx_C0402_DEV/AE_INTERIM_MAP} {COLUMN /xxx/xxx_C0402_DEV/AE_AE_INTERIM/STUDYID}} {{COLUMN /xxx/xxx_C0402_DEV/AE_SOURCE/PROT} {MAPPING /xxx/xxx_C0402_DEV/AE_INTERIM_MAP} {COLUMN /xxx/xxx_C0402_DEV/AE_AE_INTERIM/STUDYID}} {{ATTRIBUTE /xxx/AE_AE_PM/PROT} {MAPPING /xxx/xxx_C0402_DEV/AE_INTERIM_MAP} {COLUMN /xxx/xxx_C0402_DEV/AE_AE_INTERIM/STUDYID}} {{COLUMN /xxx/xxx_C0402_DEV/AE_SOURCE/PROT} {MAPPING /xxx/xxx_C0402_DEV/AE_INTERIM_MAP} {COLUMN /xxx/xxx_C0402_DEV/AE_AE_INTERIM/STUDYID}} {{COLUMN /xxx/xxx_DEV/AE_SOURCE/PROT} {MAPPING /xxx/xxx_DEV/AE_INTERIM_MAP} {ATTRIBUTE /xxx/AE_AE_PM/PROT}}

    I haven't looked in too much detail, but I think you are missing some brackets. You need to close brackets before you increment the loop. Try:
    foreach columnName $columnList {
    OMBLINEAGE DEPENDENCYTYPE 'DATAFLOW' TABLE '$tableName' COLUMN '$columnName';}
    incr j
    You will need to do the same thing at the other points in your script.

  • Simple hide a layer script need help

    Hi,
    This will be an easy one for someone. I’m new to scripting so please be patient. All I need to do is have a script that hide a layer named "L2_NonTranslatedParts". I have tried to piece together some code but I have failed. Can anyone help? I'm also not sure why we are defineing "watermark" as a var. It was in the code I cut up.
    var myDoc = app.documents.item(0);
    var L2_NonTranslatedParts = "Watermark";
    try{app.activeDocument.layers.item(L2_NonTranslatedParts).visible = false;}
    catch(_){alert("Can't find layer: " + L2_NonTranslatedParts);exit();};

    Yes, that is a good question. Really
    app.activeDocument.layers.item("L2_NonTranslatedParts").visible = false;
    should be sufficient.

  • Working on slug script, need help!

    Okay, this is not my script, one that I found online. The script works by allowing the user to set placeholders within the document and tag each placeholder with specific information such as DATE, TIME, FILENAME, etc.
    The current placeholders that are setup for this script are:
    {FILE}
    {FILEPATH}
    {FILENAME}
    {FILEEXT}
    {DATE}
    {TIME}
    I would like to add a few more placeholders, which is where I need some help. I would like to add a placeholder for the username or hostname, meaning computer name. {HOSTNAME}
    I would also like to add a placeholder for colors used in the document listed in this format:  PANTONE 186C, PANTONE 281C, BLACK, CYAN, MAGENTA, YELLOW, or as color swatches.
    Also, is it possible to create a placeholder that will produce an interface allowing user input? Say you wanted a placeholder for Designer, and a dialog popped up asking for input.
    Thanks for any help!
    Here is the script:
    var language="en";   // "de" fuer Deutsch
    var WR="WR-DateAndTime v0.9\n\n";
    var AIversion=version.slice(0,2);
    if (language == "de") {
      var format_preset = "{FILENAME}{FILEEXT} ({DATE} - {TIME})";
      var MSG_unsetmark = WR+"Dieses Objekt ist als aktuelles Datum/Uhrzeit markiert, soll die Markierung aufgehoben werden?";
      var MSG_setmark = WR+"Soll dieses Textobjekt als aktuelles Datum/Uhrzeit markiert werden?";
      var MSG_askformat = WR+"Soll das Textobjekt als Datum/Uhrzeit formatiert werden? Formate:\n{DATE}, {TIME}, {FILE}, {FILEPATH}, {FILENAME} und {FILEEXT}:"
      var MSG_editformat = WR+"Datums-/Uhrzeitformat bearbeiten (Leer = entfernen). Formate:\n{DATE}, {TIME}, {FILE}, {FILEPATH}, {FILENAME} und {FILEEXT}:"
      var MSG_notexto = WR+"Kein Textobjekt!";
      var MSG_selectedmany = "Zum Markieren als aktuelles Datum/Uhrzeit darf nur ein Textobjekt ausgew\xE4hlt sein und falls Sie die Daten aktualisieren wollen, darf kein Objekt ausgew\xE4hlt sein.";
      var MSG_nodocs = WR+"Kein Dokument ge\xF6ffnet."
      var Timeformat = 24;
      var TimeSep = ":";
      var AM = " am";
      var PM = " pm";
      var Dateformat = "dd.mm.yyyy";
    } else {
      var format_preset = "{FILENAME} ({DATE}, {TIME})";
      var MSG_unsetmark = WR+"This object is marked as actual date'n'time, do you want to remove the mark?";
      var MSG_setmark = WR+"Do you want to mark the selected textobject as actual date'n'time?";
      var MSG_askformat = WR+"Do you want to mark the textobject as actual date'n'time? Formats:\n{DATE}, {TIME}, {FILE}, {FILEPATH}, {FILENAME} and {FILEEXT}:"
      var MSG_editformat = WR+"Edit date'n'time (empty = remove). Formats:\n{DATE}, {TIME}, {FILE}, {FILEPATH}, {FILENAME} and {FILEEXT}:"
      var MSG_notexto = WR+"No textobject!";
      var MSG_selectedmany = "To mark as actual date'n'time, you have to select only one textobject. If you want to update the date'n'time-objects, there must be no object selected.";
      var MSG_nodocs = WR+"You have no open document."
      var Timeformat = 12;
      var TimeSep = ":";
      var AM = " am";
      var PM = " pm";
      var Dateformat = "mm/dd/yyyy";
    var error=0;
    if (documents.length<1) {
      error++;
      alert(MSG_nodocs)
    if (error < 1) {
      date_n_time();
    function TodayDate()
      var Today = new Date();
      var Day = Today.getDate();
      var Month = Today.getMonth() + 1;
      var Year = Today.getYear();
      var PreMon = ((Month < 10) ? "0" : "");
      var PreDay = ((Day < 10) ? "0" : "");
      if(Year < 999) Year += 1900;
              var theDate = Dateformat.replace(/dd/,PreDay+Day);
              theDate = theDate.replace(/mm/,PreMon+Month);
              theDate = theDate.replace(/d/,Day);
              theDate = theDate.replace(/m/,Month);
              theDate = theDate.replace(/yyyy/,Year);
              theDate = theDate.replace(/yy/,Year.toString().substr(2,2));
              return theDate;
    function TodayTime()
      var Today = new Date();
      var Hours = Today.getHours();
      var Minutes = Today.getMinutes();
      var Suffix = "";
      if (Timeformat == 12) {
        if (Hours >= 12 ) {
                                  Suffix = PM;
                        } else {
                          Suffix = AM;
                        if (Hours >= 13) {
                                  Hours = Hours - 12;
                        if (Hours < 1) {
                                  Hours = Hours + 12;
      var PreHour = ((Hours < 10) ? "0" : "");
      var PreMin = ((Minutes < 10) ? "0" : "");
      return PreHour+Hours+TimeSep+PreMin+Minutes+Suffix;
    function DateUpdate(Name) {
      var docpath = activeDocument.path.fsName;
      var docname = activeDocument.name.replace(/(.*?)(?:\.([^.]+))?$/,'$1');
      var extension = activeDocument.name.replace(/(.*?)(?:(\.[^.]+))?$/,'$2');
      if (docpath.slice(2,3) == "\\") {
        docsep = "\\";
      } else {
        docsep = ":";
      var content = Name.slice(11);
      var content = content.replace(/\{FILE\}/,docpath+docsep+docname);
      var content = content.replace(/\{FILEPATH\}/,docpath);
      var content = content.replace(/\{FILENAME\}/,docname);
      var content = content.replace(/\{FILEEXT\}/,extension);
      var content = content.replace(/\{DATE\}/,TodayDate());
      var content = content.replace(/\{TIME\}/,TodayTime());
      return content;
    function date_n_time()
      if (selection.length == 1) {
        if (selection[0].typename == "TextArtItem" || selection[0].typename == "TextFrame") {
          if (selection[0].name.slice(0,11) == "actualDate:") {
            dateformat = selection[0].name.slice(11);
            Check = false;
            if (AIversion == "10") {
              Check = confirm( MSG_unsetmark );
            } else {
              dateformat = prompt(MSG_editformat, dateformat);
            if(dateformat != "" && Check) {
              selection[0].contents = selection[0].name.slice(11);
              selection[0].name="";
              selection[0].selected = false;
            if(dateformat == "" && !Check) {
              selection[0].name="";
              selection[0].selected = false;
            if(dateformat && dateformat !="" && !Check) {
              selection[0].name="actualDate:"+dateformat;
              selection[0].contents = DateUpdate(selection[0].name);
          } else {
            dateformat = selection[0].contents;
            if(dateformat.search(/\{DATE\}/) == -1 && dateformat.search(/\{TIME\}/) == -1 && dateformat.search(/\{FILE[A-Z]*\}/) == -1) dateformat = format_preset;
            Check = false;
            if (AIversion == "10") {
              Check = confirm( MSG_setmark );
            } else {
              dateformat = prompt(MSG_askformat, dateformat);
            if (dateformat || Check) {
              selection[0].name="actualDate:"+dateformat;
              selection[0].contents = DateUpdate(selection[0].name);
              selection[0].selected = false;
        } else {
          alert ( MSG_notexto );
      } else if (selection.length > 1) {
        alert ( MSG_selectedmany );
      } else {
        if (AIversion == "10") {
          var textArtItems = activeDocument.textArtItems;
          for (var i = 0 ; i < textArtItems.length; i++)
            if (textArtItems[i].name.slice(0,11) == "actualDate:") {
              textArtItems[i].selected = true;
              textArtItems[i].contents = DateUpdate(textArtItems[i].name);
        } else {
          var textFrames = activeDocument.textFrames;
          for (var i = 0 ; i < textFrames.length; i++)
            if (textFrames[i].name.slice(0,11) == "actualDate:") {
              textFrames[i].selected = true;
              textFrames[i].contents = DateUpdate(textFrames[i].name);

    Okay, here is the entire script with credit lines.
    //////////////////////////////////////////////////////////// english //
    // -=> WR-DateAndTime <=-
    // A Javascript for Adobe Illustrator
    // by Wolfgang Reszel ([email protected])
    // Version 0.9 from 22.9.2011
    // This script inserts the actual date or the actual time to a
    // predefined position in the document.
    // To define the position, you'll have to create an textobject and
    // execute this script while the object is selected. The whole object
    // has to be selected and not words or letters. You can mark more
    // objects, if you select each object separate and execute
    // the script on it.
    // With the placeholders {DATE} and {TIME} you are able to define a
    // particular point, where the date or the time should be replaced.
    // If there is no placeholder in the textobject
    // "{FILENAME}{FILEEXT} ({DATE}, {TIME})" will be used as standard placeholders.
    // To update the date and time execute this script without any object
    // selected.
    // There are some additional placeholders:
    //   {FILE}     - complete document-filename with path
    //   {FILEPATH} - only the documents filepath
    //   {FILENAME} - the filename of the document
    //   {FILEEXT}  - the file extension of the document inclusive dot
    // On my system this script can't see the path of the document, when
    // it was opened directly from windows Explorer (double click).
    // In Illustrator CS it is now possible to edit a DateAndTime-Object.
    // To enable the english messages and date-format change the "de"
    // into "en" in line 90.
    // Sorry for my bad english. For any corrections send an email to:
    // [email protected]
    //////////////////////////////////////////////////////////// Deutsch //
    // -=> WR-DateAndTime <=-
    // Ein Javascript fuer Adobe Illustrator
    // von Wolfgang Reszel ([email protected])
    // Version 0.9 vom 30.9.2011
    // Dieses Skript fuegt das aktuelle Datum und die aktuelle Uhrzeit an
    // eine vorher bestimmte Stelle im Dokument ein.
    // Um eine Stelle zu bestimmen, muss man ein Textobjekt erzeugen, es
    // markieren und dann dieses Skript aufrufen. Es muss das gesamte Objekt
    // ausgewaehlt sein, nicht etwa Buchstaben oder Woerter. Es lassen sich
    // nacheinander auch mehrere Objekte als Datum/Uhrzeit markieren.
    // Mit den Platzhaltern {DATE} und {TIME} (in geschweiften Klammern)
    // kann man bestimmen, wo genau im Text das Datum und die Uhrzeit
    // erscheinen soll. Sind die Platzhalter nicht vorhanden, wird
    // automatisch "{FILENAME}{FILEEXT} ({DATE} - {TIME})" verwendet.
    // Zum Aktualisieren des Datums/Uhrzeit muss man dieses Skript aufrufen
    // wenn kein Objekt ausgewaehlt ist.
    // Es gibt noch einige zusaetzliche Platzhalter:
    //   {FILE}     - kompletter Dateiname mit Pfad
    //   {FILEPATH} - nur der Verzeichnispfad des Dokuments
    //   {FILENAME} - der Dateiname des Dokuments
    //   {FILEEXT}  - die Dateiendung des Dokuments inklusive Punkt
    // Auf meinem System kann der Pfad nicht ermittelt werden, wenn das
    // Dokument vom Windows Explorer geoeffnet wird (Doppel-Klick).
    // InÿIllustrator CSÿkann man nun ein Datum/Uhrzeit-Objekt bearbeiten.
    // Um dieses Skript mit deutschen Meldungen und Datumsformat zu
    // versehen, muss in Zeile 90 das "en" durch ein "de" ersetzt werden.
    // Verbesserungsvorschlaege an: [email protected]
    //$.bp();
    var language="en";   // "de" fuer Deutsch
    var WR="WR-DateAndTime v0.9\n\n";
    var AIversion=version.slice(0,2);
    if (language == "de") {
      var format_preset = "{FILENAME}{FILEEXT} ({DATE} - {TIME})";
      var MSG_unsetmark = WR+"Dieses Objekt ist als aktuelles Datum/Uhrzeit markiert, soll die Markierung aufgehoben werden?";
      var MSG_setmark = WR+"Soll dieses Textobjekt als aktuelles Datum/Uhrzeit markiert werden?";
      var MSG_askformat = WR+"Soll das Textobjekt als Datum/Uhrzeit formatiert werden? Formate:\n{DATE}, {TIME}, {FILE}, {FILEPATH}, {FILENAME} und {FILEEXT}:"
      var MSG_editformat = WR+"Datums-/Uhrzeitformat bearbeiten (Leer = entfernen). Formate:\n{DATE}, {TIME}, {FILE}, {FILEPATH}, {FILENAME} und {FILEEXT}:"
      var MSG_notexto = WR+"Kein Textobjekt!";
      var MSG_selectedmany = "Zum Markieren als aktuelles Datum/Uhrzeit darf nur ein Textobjekt ausgew\xE4hlt sein und falls Sie die Daten aktualisieren wollen, darf kein Objekt ausgew\xE4hlt sein.";
      var MSG_nodocs = WR+"Kein Dokument ge\xF6ffnet."
      var Timeformat = 24;
      var TimeSep = ":";
      var AM = " am";
      var PM = " pm";
      var Dateformat = "dd.mm.yyyy";
    } else {
      var format_preset = "{FILENAME} ({DATE}, {TIME})";
      var MSG_unsetmark = WR+"This object is marked as actual date'n'time, do you want to remove the mark?";
      var MSG_setmark = WR+"Do you want to mark the selected textobject as actual date'n'time?";
      var MSG_askformat = WR+"Do you want to mark the textobject as actual date'n'time? Formats:\n{DATE}, {TIME}, {FILE}, {FILEPATH}, {FILENAME} and {FILEEXT}:"
      var MSG_editformat = WR+"Edit date'n'time (empty = remove). Formats:\n{DATE}, {TIME}, {FILE}, {FILEPATH}, {FILENAME} and {FILEEXT}:"
      var MSG_notexto = WR+"No textobject!";
      var MSG_selectedmany = "To mark as actual date'n'time, you have to select only one textobject. If you want to update the date'n'time-objects, there must be no object selected.";
      var MSG_nodocs = WR+"You have no open document."
      var Timeformat = 12;
      var TimeSep = ":";
      var AM = " am";
      var PM = " pm";
      var Dateformat = "mm/dd/yyyy";
    var error=0;
    if (documents.length<1) {
      error++;
      alert(MSG_nodocs)
    if (error < 1) {
      date_n_time();
    function TodayDate()
      var Today = new Date();
      var Day = Today.getDate();
      var Month = Today.getMonth() + 1;
      var Year = Today.getYear();
      var PreMon = ((Month < 10) ? "0" : "");
      var PreDay = ((Day < 10) ? "0" : "");
      if(Year < 999) Year += 1900;
        var theDate = Dateformat.replace(/dd/,PreDay+Day);
        theDate = theDate.replace(/mm/,PreMon+Month);
        theDate = theDate.replace(/d/,Day);
        theDate = theDate.replace(/m/,Month);
        theDate = theDate.replace(/yyyy/,Year);
        theDate = theDate.replace(/yy/,Year.toString().substr(2,2));
        return theDate;
    function TodayTime()
      var Today = new Date();
      var Hours = Today.getHours();
      var Minutes = Today.getMinutes();
      var Suffix = "";
      if (Timeformat == 12) {
        if (Hours >= 12 ) {
                Suffix = PM;
            } else {
              Suffix = AM;
            if (Hours >= 13) {
                Hours = Hours - 12;
            if (Hours < 1) {
                Hours = Hours + 12;
      var PreHour = ((Hours < 10) ? "0" : "");
      var PreMin = ((Minutes < 10) ? "0" : "");
      return PreHour+Hours+TimeSep+PreMin+Minutes+Suffix;
    function DateUpdate(Name) {
      var docpath = activeDocument.path.fsName;
      var docname = activeDocument.name.replace(/(.*?)(?:\.([^.]+))?$/,'$1');
      var extension = activeDocument.name.replace(/(.*?)(?:(\.[^.]+))?$/,'$2');
      if (docpath.slice(2,3) == "\\") {
        docsep = "\\";
      } else {
        docsep = ":";
      var content = Name.slice(11);
      var content = content.replace(/\{FILE\}/,docpath+docsep+docname);
      var content = content.replace(/\{FILEPATH\}/,docpath);
      var content = content.replace(/\{FILENAME\}/,docname);
      var content = content.replace(/\{FILEEXT\}/,extension);
      var content = content.replace(/\{DATE\}/,TodayDate());
      var content = content.replace(/\{TIME\}/,TodayTime());
      return content;
    function date_n_time()
      if (selection.length == 1) {
        if (selection[0].typename == "TextArtItem" || selection[0].typename == "TextFrame") {
          if (selection[0].name.slice(0,11) == "actualDate:") {
            dateformat = selection[0].name.slice(11);
            Check = false;
            if (AIversion == "10") {
              Check = confirm( MSG_unsetmark );
            } else {
              dateformat = prompt(MSG_editformat, dateformat);
            if(dateformat != "" && Check) {
              selection[0].contents = selection[0].name.slice(11);
              selection[0].name="";
              selection[0].selected = false;
            if(dateformat == "" && !Check) {
              selection[0].name="";
              selection[0].selected = false;
            if(dateformat && dateformat !="" && !Check) {
              selection[0].name="actualDate:"+dateformat;
              selection[0].contents = DateUpdate(selection[0].name);
          } else {
            dateformat = selection[0].contents;
            if(dateformat.search(/\{DATE\}/) == -1 && dateformat.search(/\{TIME\}/) == -1 && dateformat.search(/\{FILE[A-Z]*\}/) == -1) dateformat = format_preset;
            Check = false;
            if (AIversion == "10") {
              Check = confirm( MSG_setmark );
            } else {
              dateformat = prompt(MSG_askformat, dateformat);
            if (dateformat || Check) {
              selection[0].name="actualDate:"+dateformat;
              selection[0].contents = DateUpdate(selection[0].name);
              selection[0].selected = false;
        } else {
          alert ( MSG_notexto );
      } else if (selection.length > 1) {
        alert ( MSG_selectedmany );
      } else {
        if (AIversion == "10") {
          var textArtItems = activeDocument.textArtItems;
          for (var i = 0 ; i < textArtItems.length; i++)
            if (textArtItems[i].name.slice(0,11) == "actualDate:") {
              textArtItems[i].selected = true;
              textArtItems[i].contents = DateUpdate(textArtItems[i].name);
        } else {
          var textFrames = activeDocument.textFrames;
          for (var i = 0 ; i < textFrames.length; i++)
            if (textFrames[i].name.slice(0,11) == "actualDate:") {
              textFrames[i].selected = true;
              textFrames[i].contents = DateUpdate(textFrames[i].name);

  • [AS] Beast of a script needs help converting from Quark 8 to InDesign CS5

    First off, THANK YOU for even reading this post. Here's the dilema. I work in a publishing company that used an AppleScript from Quark 8 to automate our pagination from set text we pull from our sales reps worksheets. About 8 months ago we switched fully to InDesign CS5, but have had to hold onto Quark 8 to be able to keep running our pagination. I'd like to see if the geniuses (yes, I've been trolling these forums looking to solve this myself and seen some great problems fixed) on these forums can help me figure out the proper conversion I would need to be able to leave Quark 8 in the rearview.
    Here's our current code... (I warned you it was a beast)
    set Ad_Props to {¬
         {Ad_Label:"SPREAD – ", Ad_Width:2.495, Ad_Height:1.62, Ad_Text_Angle:0}, ¬
         {Ad_Label:"FULL – ", Ad_Width:1.225, Ad_Height:1.62, Ad_Text_Angle:0}, ¬
         {Ad_Label:"SPREAD – ", Ad_Width:2.495, Ad_Height:1.62, Ad_Text_Angle:0}, ¬
         {Ad_Label:"JUNIOR – ", Ad_Width:0.90625, Ad_Height:1.62, Ad_Text_Angle:0}, ¬
         {Ad_Label:"1/2H – ", Ad_Width:1.225, Ad_Height:0.785, Ad_Text_Angle:0}, ¬
         {Ad_Label:"1/2V – ", Ad_Width:0.5875, Ad_Height:1.62, Ad_Text_Angle:90}, ¬
         {Ad_Label:"1/3V – ", Ad_Width:0.5875, Ad_Height:1.2025, Ad_Text_Angle:90}, ¬
         {Ad_Label:"1/4 – ", Ad_Width:0.5875, Ad_Height:0.785, Ad_Text_Angle:0}, ¬
         {Ad_Label:"1/4 Strip – ", Ad_Width:0.26875, Ad_Height:1.62, Ad_Text_Angle:90}, ¬
         {Ad_Label:"1/8H – ", Ad_Width:0.5875, Ad_Height:0.3675, Ad_Text_Angle:0}, ¬
         {Ad_Label:"1/8V – ", Ad_Width:0.26875, Ad_Height:0.785, Ad_Text_Angle:90}, ¬
         {Ad_Label:"Junior (GOLF) – ", Ad_Width:0.8, Ad_Height:1.62, Ad_Text_Angle:0}, ¬
         {Ad_Label:"1/3V (GOLF) – ", Ad_Width:0.375, Ad_Height:1.62, Ad_Text_Angle:90}, ¬
         {Ad_Label:"1/3sq. (GOLF) – ", Ad_Width:0.8, Ad_Height:0.785, Ad_Text_Angle:0}, ¬
         {Ad_Label:"1/6V (GOLF) – ", Ad_Width:0.375, Ad_Height:0.785, Ad_Text_Angle:90}, ¬
         {Ad_Label:"Directory Listing Only – ", Ad_Width:0.3, Ad_Height:0.3, Ad_Text_Angle:0}, ¬
         {Ad_Label:"INSERT (# in notes) – ", Ad_Width:0.3, Ad_Height:0.3, Ad_Text_Angle:0}, ¬
         {Ad_Label:"Other (See Notes) – ", Ad_Width:0.3, Ad_Height:0.3, Ad_Text_Angle:0}, ¬
         {Ad_Label:"------------ – ", Ad_Width:0.3, Ad_Height:0.3, Ad_Text_Angle:0}}
    set Position_Width to number
    set Position_Width to 11.375
    set Position_Height to number
    set Position_Height to 1.875
    set Jump_Height to number
    set Jump_Height to 0
    set Variable_Count to number
    set Variable_Count to 0
    set Variable_Height to number
    set Variable_Height to (1.875 + (1.62 * Variable_Count))
    set Last_Ad to number
    set Last_Ad to 0
    tell application "QuarkXPress"
         activate
         try
              display dialog "WARNING: This version of 'Dummy Square Maker' runs much slower than the last version, a confirmation will tell you when you are finished. Please be patient." & return & return & "Make sure to have the text box selected" buttons {"Cancel", "Accept"} default button 2 with icon caution
              set ThisBox to object reference of current box
              tell story 1 of ThisBox
                   set (every paragraph where it is return) to ""
                   set style sheet of every text to null
                   set style sheet of every text to "DUMMY TEXTS"
                   repeat with i from 1 to (count of paragraphs)
                        try
                             tell paragraph i
                                  set ThePage to my get_CurrentPage()
                                  try
                                       if it contains " – " then
                                            set style sheet to "AD SIZE"
                                            set Ad_Size to contents
                                            set {This_Width, This_Height, this_angle} to {"", "", ""}
                                            repeat with This_Ad in Ad_Props
                                                 if Ad_Size contains (Ad_Label of This_Ad) then
                                                      set This_Width to Ad_Width of This_Ad
                                                      set This_Height to Ad_Height of This_Ad
                                                      set this_angle to Ad_Text_Angle of This_Ad
                                                      exit repeat
                                                 end if
                                            end repeat
                                            set Ad_Box to my Make_Box(ThePage, {1.875, 10.875, This_Height + 1.875, This_Width + 10.875}, this_angle)
                                            duplicate contents to (end of Ad_Box)
                                       else if it contains "—" then
                                            set style sheet to "AD REP/PLACEMENT"
                                            duplicate contents to (end of Ad_Box)
                                       else if it starts with "©" then
                                            set style sheet to "AD REP/PLACEMENT"
                                            delete (character 1)
                                            duplicate contents to end of Ad_Box
                                            if Position_Width ≤ 19.75 then
                                                 set Jump_Height to Jump_Height + This_Height
                                                 (*_________________This is where Ad Boxes Stack_________________*)
                                                 if (Jump_Height ≤ 1.62) then
                                                      set origin of bounds of Ad_Box to {Position_Height, Position_Width}
                                                      set Position_Height to Position_Height + This_Height
                                                      (*_________________This is where Ad Boxes more right_________________*)
                                                 else
                                                      set Position_Height to Variable_Height
                                                      (*set Position_Width to Position_Width + This_Width + 0.05*)
                                                      set Position_Width to Position_Width + Last_Ad + 0.05
                                                      set origin of bounds of Ad_Box to {Position_Height, Position_Width}
                                                      set Jump_Height to This_Height
                                                      set Position_Height to Variable_Height + This_Height
                                                 end if
                                                 set Last_Ad to This_Width
                                                 (*_________________This is where New Row appears_________________*)
                                            else
                                                 set Position_Width to 11.375
                                                 set Variable_Count to Variable_Count + 1
                                                 set Variable_Height to (1.875 + (1.62 * Variable_Count))
                                                 set Position_Height to Variable_Height
                                                 set origin of bounds of Ad_Box to {Position_Height, Position_Width}
                                                 set Position_Height to Position_Height + This_Height
                                                 set Jump_Height to This_Height
                                                 set Last_Ad to This_Width
                                            end if
                                       else
                                            duplicate contents to (end of Ad_Box)
                                       end if
                                  end try
                             end tell
                        on error errmsg number errnum
                             display dialog "There has been an error " & "[" & i & "] (" & errmsg & " [" & errnum & "])" buttons {"Okay"} default button 1 with icon stop
                        end try
                   end repeat
                   delete contents
                   set style sheet of every text to null
              end tell
              beep 2
              display dialog "Automation Finished" & return & return & "IMPORTANT NOTE: Color your Ad Squares according to Sales Rep, and select them all and 'BRING TO FRONT [F5]', this is VITAL." buttons {"Okay"} default button 1 with icon stop
         on error errmsg number errnum
              beep 3
              if errnum ≠ -128 then
                   beep
                   display dialog errmsg & " [" & errnum & "]" buttons {"OK"} default button 1 with icon stop
              end if
         end try
    end tell
    on Make_Box(ThePage, TheBounds, this_angle)
         local ThePage, TheBounds, this_angle
         tell application "QuarkXPress"
              tell page ThePage of document 1
                   set Ad_Box to make new text box at end with properties {bounds:TheBounds, vertical justification:centered, color:"Rep_Other", shade:100, opacity:10, text angle:this_angle, frame:{style:solid line, color:"Black", shade:60, width:0.1}}
              end tell
         end tell
         (*end tell*)
         return Ad_Box
    end Make_Box
    on get_CurrentPage()
         tell application "QuarkXPress"
              tell document 1
                   return page number of current page
              end tell
         end tell
    end get_CurrentPage

    Hi,
    I think with this, you can already make good progress in your work.
    Good luck!
    global mydocument
    tell application "Adobe InDesign CS5.5"
         set mydocument to active document
         tell mydocument
              set myParaStyle to paragraph style "DUMMY TEXTS"
              tell page 1
                   set TheBounds to {0, 0, 20, 50}
                   set Ad_Box to make text frame
                   tell Ad_Box
                        set geometric bounds to TheBounds
                        set vertical justification of text frame preferences to center align
                        set contents to "This is the contents"
                   end tell
                   set myStory to parent story of Ad_Box
                   set applied paragraph style of every paragraph of myStory to myParaStyle
              end tell
         end tell
    end tell
    Your two handlers then look like this:
    on Make_Box(ThePage, TheBounds, this_angle)
         local ThePage, TheBounds, this_angle
         tell application "Adobe InDesign CS5.5"
              tell page ThePage of mydocument
                   set Ad_Box to make text frame
                   tell Ad_Box
                        set geometric bounds to TheBounds
                        set vertical justification of text frame preferences to center align
                   end tell
              end tell
         end tell
         return Ad_Box
    end Make_Box
    on get_CurrentPage(CurrentTextFrame)
         tell application "Adobe InDesign CS5.5"
              tell mydocument
                   return name of parent page of parent page of CurrentTextFrame
              end tell
         end tell
    end get_CurrentPage
    Shorter version:
    on get_CurrentPage(CurrentTextFrame)
         tell mydocument of application "Adobe InDesign CS5.5"
              return name of parent page of parent page of CurrentTextFrame
         end tell
    end get_CurrentPage
    Ce message a été modifié par: OlivierBerquin

  • Problem with script – NEED HELP

    HELP!!! why isn't the script working?
    on adding folder items to thefolder after receiving theAddedItems
    repeat with eachitem in theAddedItems
    set theSender to "me<[email protected]>"
    set recipCommon to "Files"
    set recipAddress to (choose from list {"User 1", "User 2", "User 3"} with prompt "Select a recipient :") as text
    if result is "User 1" then
    set recipAddress to {"User 1 <[email protected]>"}
    else if result is "User 2" then
    set recipAddress to {"User 2 <[email protected]>"}
    else if result is "User 3" then
    set recipAddress to {"User 3 <[email protected]>", "[email protected]>"}
    end if
    set msgText to " type body copy here "
    tell application "Mail"
    set newmessage to make new outgoing message with properties {content:msgText & return}
    tell newmessage
    set sender to theSender
    tell application "Finder" to set theSubject to name of eachitem
    set subject to theSubject
    repeat with eachRecipient in recipAddress
    make new to recipient at end of to recipients with properties {name:recipCommon, address:eachrecipAddress}
    end repeat
    end tell
    send newmessage
    end tell
    end repeat
    end adding folder items to

    HELP......
    !!!Everything works in the below script except it doesn't send the email?!!!
    on adding folder items to thefolder after receiving theAddedItems
    repeat with eachitem in theAddedItems
    set theSender to "me<[email protected]>"
    set recipCommon to "Files"
    set recipAddress to (choose from list {"User 1", "User 2", "User 3"} with prompt "Select a recipient :") as text
    if result is "User 1" then
    set recipAddress to {"User 1 <[email protected]>"}
    else if result is "User 2" then
    set recipAddress to {"User 2 <[email protected]>"}
    else if result is "User 3" then
    set recipAddress to {"User 3 <[email protected]>", "[email protected]>"}
    end if
    set msgText to " type body copy here "
    tell application "Mail"
    set newmessage to make new outgoing message with properties {content:msgText & return}
    tell newmessage
    set visible to true
    set sender to theSender
    tell application "Finder" to set theSubject to name of eachitem
    set subject to theSubject
    repeat with eachRecipient in recipAddress
    make new to recipient at end of to recipients with properties {name:recipCommon, address:eachRecipient}
    end repeat
    repeat with eachRecipient in recipAddress
    make new to recipient at end of to recipient with properties {name:recipCommon, address:recipAddress}
    set eachRecipient to contents of eachRecipient
    end repeat
    end tell

  • Task Scheduling Script - Need help with passing the scheduled command (variables are not being evaluated)

    Hi Everyone,
    I'm trying to get a simple task scheduler script to work for me and can't get the command I need passed to the scheduler to evaluate properly.
    Here's the script:
    ###Create a new task running $Command and execute it Daily at 6am.
    $TaskName = Read-Host 'What would you like this job to be named?'
    $Proto = Read-Host 'What is the protocol? (FTP/FTPS/SFTP)'
    $User = Read-Host 'What is the user name?'
    $Pwd = Read-Host 'What is the password?'
    $Server = Read-Host 'What is the server address?'
    $NetworkDir = Read-Host 'Please input the network location of the file(s) you wish to send. Refer to documentation for more details.'
    $RemoteDir = Read-Host 'Please input the REMOTE directory to which you will upload your files. If there is none please input a slash'
    $Command = 'winscp.com /command "option batch abort" "option confirm off" "open $Proto://$User:$Pwd@$Server" "put $NetworkDir $RemoteDir" "exit"'
    $TaskAction = New-ScheduledTaskAction -Execute "$Command"
    $TaskTrigger = New-ScheduledTaskTrigger -Daily -At 6am
    Register-ScheduledTask -Action $TaskAction -Trigger $Tasktrigger -TaskName "$TaskName" -User "Administrator" -RunLevel Highest
    Write-Host "$TaskName created to run Daily at $TaskStartTime"
    What's messing up is the $Command creation, the command needs to have the quotes around "option blah blah", but if I wrap the whole line in single quotes the variables that are evaluated for the "open blah blah" strings (which also need
    to be inside quotes) and the "put blah blah" string are not being evaluated properly.
    I've dorked about with different bracketing and quoting but can't nail the syntax down, could someone point me in the right direction? My Google-fu seems to be lacking when it comes to nailing down this issue.
    Thanks

    Hmmn, closer. I'm getting this error now:
    + $Command = $tmpl -f  $User, $Pwd, $Server, $NetworkDir, $RemoteDir
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (winscp.com /com...t {4} {5}" exit:String) [], RuntimeException
        + FullyQualifiedErrorId : FormatError
    And the command being added to the new task looks like this:
    winscp.com /command "option batch abort" "option confirm off" "open ($Proto)://($User):($Pwd)@($Server)" "put $NetworkDir $RemoteDir" "exit"
    Here's the current state of the script. I get what you're doing to try to bypass the quotes issue, using an array. I'm just not awesome at this yet sooooooo...
    $TaskName = Read-Host 'What would you like this job to be named?'
    $Proto = Read-Host 'What is the protocol? (FTP/FTPS/SFTP)'
    $User = Read-Host 'What is the user name?'
    $Pwd = Read-Host 'What is the password?'
    $Server = Read-Host 'What is the server address?'
    $NetworkDir = Read-Host 'Please input the network location of the file(s) you wish to send. Refer to documentation for more details.'
    $RemoteDir = Read-Host 'Please input the REMOTE directory to which you will upload your files. If there is none please input a slash'
    $tmpl = 'winscp.com /command "option batch abort" "option confirm off" "open {0}://{1}:{2}@{3}" "put {4} {5}" exit'
    $Command = $tmpl -f $User, $Pwd, $Server, $NetworkDir, $RemoteDir
    $TaskAction = New-ScheduledTaskAction -Execute $Command
    $TaskTrigger = New-ScheduledTaskTrigger -Daily -At 6am
    Register-ScheduledTask -Action $TaskAction -Trigger $Tasktrigger -TaskName "$TaskName" -User "Administrator" -RunLevel Highest
    Write-Host "$TaskName created to run Daily at $TaskStartTime"

  • Newbie at Illustrator scripting needs help assigning image

    I am trying to copy a graphic stored in a vb.net picturebox.image into an activeLayer of an illustrator document. Can anyone supply me with code as to how to do it. Also is there a way to lookup a swatch by name and not have to rely on knowing it's index as in this line of code : pathRef.StrokeColor = docRef.Swatches(3).Color. I know the swatch's name is "CutContour" I would like to assign it by name. And lastly does anybody know any good books, links, etc.. that show you how to do this kind of stuff.
    Thanks,
    Bruce
    Imports IDAutomation.Windows.Forms.LinearBarCode
    Imports Illustrator
    Public Class FormMain
        Dim barcode As IDAutomation.Windows.Forms.LinearBarCode.Barcode = New Barcode()
        Dim illustrator As Illustrator.Application = CreateObject("Illustrator.Application")
        Dim filePath As String = My.Application.Info.DirectoryPath
        Private Sub FormMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            barcode.SymbologyID = barcode.Symbologies.Code39Ext
            barcode.BarHeightCM = 1
            barcode.XDimensionCM = 0.03
            barcode.NarrowToWideRatio = 2
            barcode.LeftMarginCM = 0.201
            barcode.TopMarginCM = 0.201
            barcode.TextMarginCM = 0.051
            barcode.ShowText = False
            barcode.CaptionBottomAlignment = StringAlignment.Center
            barcode.CaptionBottomSpace = 0.03
            Dim barcodeText As String = "CODE39UPC" 'hard code barcode content for this test
            barcode.DataToEncode = "*" + barcodeText + "*"
            barcode.CaptionBelow = barcodeText
            PictureBox1.Image = barcode.BMPPicture 'Display Barcode
            barcode.SaveImageAs(".\upc.png", System.Drawing.Imaging.ImageFormat.Png)
            Dim fileName As String = filePath + "\Roland VersaWorks.eps"
            Try
                 illustrator.Open(fileName)
             Catch err As Exception
                 MsgBox("Missing File: " + fileName)
                 illustrator.Quit()
                 Me.Close()
             End Try
            Dim docRef As Illustrator.Document = illustrator.ActiveDocument
            Dim pathRef As Illustrator.PathItem = docRef.ActiveLayer.PathItems.Rectangle(100, 0, 300, 100)
            pathRef.StrokeColor = docRef.Swatches(3).Color 'Set strokeColor to CutContour Swatch
            pathRef.Filled = False ' Don't Fill rectangle with anything
            docRef.ActiveLayer = docRef.Layers(2) 'Activate UPC Layer
            '############## I need to copy PictureBox1.image into this activeLayer! How do I do it? ###########
            Dim epsOptions As Illustrator.EPSSaveOptions = CreateObject("Illustrator.EPSSaveOptions")
            epsOptions.CMYKPostScript = True
            docRef.SaveAs(filePath + "\test.eps", epsOptions)
            illustrator.Quit()
            Me.Close()
        End Sub
    End Class

    Hi,
    Hodge-Podge wrote:
    Also is there a way to lookup a swatch by name and not have to rely on knowing it's index as in this line of code : pathRef.StrokeColor = docRef.Swatches(3).Color. I know the swatch's name is "CutContour" I would like to assign it by name.
    I have no knowledge in VB, but in javascript
    it should be called by:
    var mySwatche=app.activeDocument.swatches.getByName("CutContour");
    Regarding how to copy, i guess that you can load picture as raster / placed items or cut() & paste()... it's just ideas,
    Sorry, art.chrome

  • Creating Basic Calculator Script - Needs help

    I'd like to create a basic calculator script that makes doing calculations a bit easier from the command line.  Normally i do:
    echo "32*24" | bc
    So I built a bash script that I can just type "calc 32*24":
    bc << EOF
    scale=4
    $@
    quit
    EOF
    And it works ok until i try to use parenthesis:
    calc (1+49)/5
    bash: syntax error near unexpected token `1+49'
    if I use parenthesis, directly in the bc command it does ok:
    bc
    bc 1.06...
    (1+49)/5
    10
    I've tried putting $@ in quotes but not luck.  Looks like bash isn't transferring the parenthesis.  How can I get the bash script to pass theparenthesis?

    Dusty wrote:This is why I always have at least one terminal in an IPython session.
    +1!
    I normally use a standard python instance in the same way but have just installed ipython and am having a look at it now. Looks cool!

  • New to shell script need help for script

    Hi,
    I have following shell script which takes database name from file sql.config. this file has names of all staging database. I want to modify this script to run below analyze index commands if database is staging and if its production database then i want to run different set of commands say analyze user schemas. How can i implement this in below script (something like if then else)?
    connstr=`grep "gemsit_staging" /cronacle/tools/informatica/sql.config`
    sqlplus -S<<EOF1
    $connstr
    whenever sqlerror exit failure;
    ANALYZE TABLE GEMSIT_STAGING.AR_TRANS_DETAIL_STG COMPUTE STATISTICS;
    ANALYZE TABLE GEMSIT_STAGING.GLOBAL_SET_S COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.AR_DEL_TRANS_DETAIL_STG_PK COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.AR_DEL_TRANS_DETAIL_STG_01 COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.AR_TRANS_DETAIL_STG_PK COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.AR_TRANS_DETAIL_STG01_IX COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.AR_TRANS_DETAIL_STG02_IX COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.AR_TRANS_DETAIL_STG03_IX COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.AR_TRANS_DETAIL_STG04_IX COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.AR_TRANS_DETAIL_STG05_IX COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.AR_TRANS_DETAIL_STG06_IX COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.AR_TRANS_DETAIL_STG07_IX COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.GLOBAL_SET_S_PK COMPUTE STATISTICS;
    ANALYZE INDEX GEMSIT_STAGING.GLOBAL_SET_S_PK1 COMPUTE STATISTICS;
    EOF1
    thanks

    if test $? -ne 0 ; then
                                    echo 'Processing Error' >> $Log_Dir/$Log_File
                                     exit 1
                            else
                                    echo 'Processing Completed' >> $Log_Dir/$Log_File
                                    rm -f  $Script_Dir/$Flag_File
                                     exit 0
                            ficreate two sql files one form test and for prod say test.sql and prod.sql with relevant sql statements
    this is a sample if else construct, you nned to get the env using "host"/"hostname" cmd on linux and assign this to a variable say envname
    if envname $? -ne 'PR' ; then
                                    echo 'Processing Test SQL' >> $Log_Dir/$Log_File
                                     <call the test sql here>
                                     exit 1
                            else
                                    echo 'Processing Prod SQL' >> $Log_Dir/$Log_File
                                   <call the Prod sql here>
                            fi

  • My first script needs help

    text<tab>{findWhat:”<U+0394>”}<tab>{appliedCharacterStyle:”Symbol”}<tab>{includeFootnotes: true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    In this case, I want to swap the Greek letter Delta, which is its codepoint U + 0394, for a specific character style (the style is called Symbol).
    The question is: is written right?
    Where should I put it? Because I'm just adding this line in an existing code ...
    Thanks anyway to everyone! ^^

    Hi,
    You could  use "grep" mode instead of "text". I mean:
    grep<tab>{findWhat:"\x{394}"}<tab>{appliedCharacterStyle:"Symbol"}<tab>{includeFootnotes:t rue, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    findWhat:"\x{394}" means to find a unicode with specified number (the number you can see in InDesign Info Panel).
    This should be placed as a one of lines inside "FindChangeList.txt" file before "FindChangeByList.jsx" run.
    Jarek

  • Need help in writing a vbs script

    I am very new to scripting and need help in scripting the following:
    When the Windows 7 machine boots up or a user logs on (easy to do with GPO), I want to execute a script that starts some services
    ONLY if the length of the computer name is less than or equal to 15 else it should exit. It has to be done in the background without any user interaction.
    The script should be able to work for both x86 and x64 version of Win7.
    Any help would be greatly appreciated.
    Thanks in advance.
    JD
    JD

    Hi,
    I highly recommend that you skip VBScript and learn PowerShell instead. This is pretty trivial in PowerShell:
    If ($env:COMPUTERNAME.Length -le 15) {
    # Do stuff
    # HINT: Look into Start-Service
    Write-Host "Under limit: $env:COMPUTERNAME"
    } Else {
    # Do optional stuff
    Write-Host "Over limit: $env:COMPUTERNAME"
    (OT: jrv - happy? =])
    If you must stick with VBScript for some odd reason, here's an example to get you started:
    Set wshNetwork = WScript.CreateObject( "WScript.Network" )
    strComputerName = wshNetwork.ComputerName
    If Len(strComputerName) <= 15 Then
    'Do stuff here when the name is short enough
    WScript.Echo "Under limit: " & strComputerName
    Else
    'Do stuff here when the name is too long (only if you want to)
    WScript.Echo "Over limit: " & strComputerName
    End If
    http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/services/
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • I need help to modify my AS script

    I have the following script and I would like to modify it:
    1.On this file I need to type the name of some video Albums in order to be displayed in the SWF file.
    2. What I wanr is that this file read the specific folder and read the directories which they will be the names of the Albums
    How can I do this?
    One more thing is that this file was created to work with Flas CS3 and I am trying to test it with CS5.
    I really appreciate the whole help I can get.
    I don't know anything about AS2 nor AS3, I only know hoe to modify the files by following comments and other samples from all around the web.
    Thanks and I hope someone can help me, I've been trying few thing but I just stuck. So I really need help.
    //  Set the path to the External Parameters file relative to the *.swf file.
    //  If this file cannot be found or if it contains errors, the
    //  Internal Parameters(the parameters below) will be used.
    //var ParametersFile = "MyControls.xml";
    var ParametersFile = "XML_Files/MyControls.xml";
    //  Set the path to the Theme file relative to the *.swf file.
    //  If this file cannot be found or if it contains errors, the
    //  Default Grey skin will be used instead.
    //  To learn how to edit Themes, please refer to the 'Help' folder.
    // next line commented by SAMY
    //var ThemeFile = "Theme.xml";
    // NEXT LINE ADDED BY SAMY
    var ThemeFile = "FLASH_DIR/3D_GALLERY/BlueTheme.xml";
    //  To learn more about how to add albums, please refer to the
    //  'Help' folder. This line says that replace and modify the name of the title album and the xml file which is as shown here
    var AlbumLabel_1 = "Pastor Alejandro Bullon";//<-- This is the typical line that I want to be input from the external folder name *
    //var AlbumDataFile_1 = "Videos/Alejandro_B/Alejandro_Bullon.xml";
    // next line for website configuration typical
    //var AlbumDataFile_1 = "Media/Media.xml";
    //next line works fine locally
    //var AlbumDataFile_1 = "Videos/Videos_website.xml";
    var AlbumDataFile_1 = "FLASH_DIR/3D_GALLERY/Videos/Alejandro_B/Alejandro_B.xml";
    var AlbumLabel_2 = "Pastor Stephen Bohr";// <--  *
    // next line commented by samy
    var AlbumDataFile_2 = "FLASH_DIR/3D_GALLERY/Videos/Stephen_B/Stephen_Bohr.xml";
    // next line added by samy for website configuration typical for all albums
    //var AlbumDataFile_2 = "Videos/Videos.xml";
    var AlbumLabel_3 = "Pastor Caleb Jara";
    var AlbumDataFile_3 = "FLASH_DIR/3D_GALLERY/Videos/Caleb_Jara/Caleb_Jara.xml";
    //var AlbumDataFile_3 = "City/City.xml";
    var AlbumLabel_4 = "Pastor Doug_Batchellor";
    var AlbumDataFile_4 = "FLASH_DIR/3D_GALLERY/Videos/Doug_B/Doug_Batchellor.xml";
    //var AlbumDataFile_4 = "FLASH_DIR/3D_GALLERY/City/City.xml";
    var AlbumLabel_5 = "Musica";
    var AlbumDataFile_5 = "FLASH_DIR/3D_GALLERY/Musica/Musica.xml";
    //var AlbumDataFile_5 = "Landscape/Landscape.xml";
    var AlbumLabel_6 = "Powerpoint";
    var AlbumDataFile_6 = "FLASH_DIR/3D_GALLERY/Powerpoint/Powerpoint.xml";
    var AlbumLabel_7 = "Escuela Sabatica '10";
    var AlbumDataFile_7 = "FLASH_DIR/3D_GALLERY/Escuela_Sab/Esc_Sab_2010.xml";
    var AlbumLabel_8 = "Escuela Sabatica '11";
    var AlbumDataFile_8 = "FLASH_DIR/3D_GALLERY/Escuela_Sab/Esc_Sab_2011.xml";
    var AlbumLabel_9 = "Test Nature";
    var AlbumDataFile_9 = "Nature/Nature.xml";
    //  Select wether to enable or disable error messages created
    //  due to 'file not found' , 'format not supported' or 'corrupted
    //  XML files' type of errors.
    //  Note: There error messages are automatically disabled when you
    //  export your *.swf file.
    var EnableErrorMessages = "yes";//[Yes  , No]
    //  Set parameters for items.
    var ItemWidth = 170;
    var ItemHeight= 130;
    var ShowItemNumber = "yes";
    //var ShowItemNumber = "no";
    //  Select fitting technique , stretch the thumb picture to fit the item
    //  or crop it from the top left.
    var ThumbFittingMethod = "stretch";
    //  Select what to do when the file preview is clicked, either to enlarge
    //  the preview or navigate to the URL provided for the current item in
    //  the XML data file of the current album
    var WhenPreviewIsClicked = "Enlarge";//[Enlarge  , GetUrl]
    //  Select the window target, '_blank' to open a new window or '_self' to
    //  navigate to the URL in the same window
    var WindowTarget = "_blank";
    //  Select wether to show the information of the item or not
    var ShowItemInfo = "yes";
    //  Select wether to show the albums menu or not
    var ShowAlbumsMenu = "yes";
    //  Select wether to show the video controller or not
    var ShowVideoController = "yes";
    //  Select wether to show the autoplay option or not
    //var ShowAutoplayButton="no";
    var ShowAutoplayButton="yes";
    //  Set the delay time for autoplay, this will be used for pictures only
    var AutoplayDelayTime = 5;
    //  Set the spinning speed of a single wheel
    //var WheelSpinningSpeed = 5;
    var WheelSpinningSpeed = 2;
    //  Select direction of scrolling of pages
    var DefaultDirection = "LeftToRight";
    //  Select wether you want to disable one of the wheels
    var DisableWheel = "none";
    //  Set the maximum number of items to be loaded on a single wheel
    var MaximumLoadOnEachWheel = 10;
    //  Select how you want the wheel to interact with the mouse
    //  Refer to the 'Help' folder for more information.
    var ScrollingStyle = "2";
    //  Select wether to enable tool tips or not.
    var EnableToolTips = "yes";
    //  Set the delay time for the tool tips to appear
    var ToolTipsDelayTime = 1;
    //  This is like a shortcut, set this parameter to 'Name' to display
    //  the name of the item as a tool tip.......
    var ToolTipsContent = "tooltips";//[ToolTips , Name , FileType]
    //  Select wether to enable or disable visual effects.
    var EnableDepthOfField = "yes";
    var EnableMotionBlur = "yes";
    Message was edited by: samy4movies

    This is a web-based app. And the application is for a carrousel video gallery.
    I already figure out the auto XML generator with php, but I think I want to get all in one process. Meaning that I only want to upload my videos and run php codes by themselves and not to worry in adding or modifying the *.fla file everytime that I insert a new folder ("Album").
    This is the link for the project I am working 
    http://anaheimspanish.net/index.php?option=com_content&view=article&id=98&Itemid=124
    It's called 3D Video Gallery, I bought the component through a website for flash components, but their support is not very good, that's why I want to fix as much as I need.
    Thanks in advance for your help
    If you need a full zip project to test it, let me know.

  • I need help with this script please ASAP

    So I need this to work properly, but when ran and the correct answer is chosen the app quits but when the wrong answer is chosen the app goes on to the next question. I need help with this ASAP, it is due tommorow. Thank you so much for the help if you can.
    The script (Sorry if it's a bit long):
    #------------Startup-------------
    display dialog "Social Studies Exchange Trviva Game by Justin Parzik" buttons {"Take the Quiz", "Cyaaaa"} default button 1
    set Lolz to (button returned of the result)
    if Lolz is "Cyaaaa" then
    killapp()
    else if Lolz is "Take the Quiz" then
              do shell script "say -v samantha Ok starting in 3…2…1…GO!"
    #------------Question 1-----------
              display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
              set A1 to (button returned of the result)
              if A1 is "Apprentices" then
                        do shell script "say -v samantha Correct Answer"
              else
                        do shell script "say -v samantha Wrong Answer"
      #----------Question 2--------
                        display dialog "Most children were taught
    to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
                        set A2 to (button returned of the result)
                        if A2 is "Bible" then
                                  do shell script "say -v samantha Correct Answer"
                        else
                                  do shell script "say -v samantha Wrong Answer"
      #------------Question 3---------
                                  display dialog "In the 1730s and 1740s, a religious movement called the_______swept through the colonies." buttons {"Glorius Revolution", "Great Awakening", "The Enlightenment"}
                                  set A3 to (button returned of the result)
                                  if A3 is "Great Awakening" then
                                            do shell script "say -v samantha Correct Answer"
                                  else
                                            do shell script "say -v samantha Wrong Answer"
      #-----------Question 4--------
                                            display dialog "_______ was
    a famous American Enlightenment figure." buttons {"Ben Franklin", "George Washington", "Jesus"}
                                            set A4 to (button returned of the result)
                                            if A4 is "Ben Franklin" then
                                                      do shell script "say -v samantha Correct Answer"
                                            else
                                                      do shell script "say -v samantha Wrong Answer"
      #----------Question 5-------
                                                      display dialog "______ ownership gave colonists political rights as well as prosperity." buttons {"Land", "Dog", "Slave"}
                                                      set A5 to (button returned of the result)
                                                      if A5 is "Land" then
                                                                do shell script "say -v samantha Correct Answer"
                                                      else
                                                                do shell script "say -v samantha Wrong Answer"
      #---------Question 6--------
                                                                display dialog "The first step toward guaranteeing these rights came in 1215. That
    year, a group of English noblemen forced King John to accept the…" buttons {"Declaration of Independence", "Magna Carta", "Constitution"}
                                                                set A6 to (button returned of the result)
                                                                if A6 is "Magna Carta" then
                                                                          do shell script "say -v samantha Correct Answer"
                                                                else
                                                                          do shell script "say -v samantha Wrong Answer"
      #----------Question 7--------
                                                                          display dialog "England's cheif lawmaking body was" buttons {"the Senate", "Parliament", "King George"}
                                                                          set A7 to (button returned of the result)
                                                                          if A7 is "Parliament" then
                                                                                    do shell script "say -v samantha Correct Answer"
                                                                          else
                                                                                    do shell script "say -v samantha Wrong Answer"
      #--------Question 8-----
                                                                                    display dialog "Pariliament decided to overthrow _______ for not respecting their rights" buttons {"King James II", "King George", "King Elizabeth"}
                                                                                    set A8 to (button returned of the result)
                                                                                    if A8 is "King James II" then
                                                                                              do shell script "say -v samantha Correct Answer"
                                                                                    else
                                                                                              do shell script "say -v samantha Wrong Answer"
      #--------Question 9------
                                                                                              display dialog "Parliament named ___ and ___ as England's new monarchs in something called ____." buttons {"William/Mary/Glorius Revolution", "Adam/Eve/Great Awakening", "Johhny/Mr.Laphalm/Burning of the hand ceremony"}
                                                                                              set A9 to (button returned of the result)
                                                                                              if A9 is "William/Mary/Glorius Revolution" then
                                                                                                        do shell script "say -v samantha Correct Answer"
                                                                                              else
                                                                                                        do shell script "say -v samantha Wrong Answer"
      #---------Question 10-----
                                                                                                        display dialog "After accepting the throne William and Mary agreed in 1689 to uphold the English Bill of _____." buttons {"Money", "Colonies", "Rights"}
                                                                                                        set A10 to (button returned of the result)
                                                                                                        if A10 is "Rights" then
                                                                                                                  do shell script "say -v samantha Correct Answer"
                                                                                                        else
                                                                                                                  do shell script "say -v samantha Wrong Answer"
      #---------Question 11------
                                                                                                                  display dialog "By the late 1600s French explorers had claimed the ___ River Valey" buttons {"Mississippi", "Ohio", "Hudson"}
                                                                                                                  set A11 to (button returned of the result)
                                                                                                                  if A11 is "Ohio" then
                                                                                                                            do shell script "say -v samantha Correct Answer"
                                                                                                                  else
                                                                                                                            do shell script "say -v samantha Wrong Answer"
      #------Question 12---------
                                                                                                                            display dialog "______ was sent to ask the French to leave 'English Land'." buttons {"Johhny Tremain", "George Washington", "Paul Revere"}
                                                                                                                            set A12 to (button returned of the result)
                                                                                                                            if A12 is "George Washington" then
                                                                                                                                      do shell script "say -v samantha Correct Answer"
                                                                                                                            else
                                                                                                                                      do shell script "say -v samantha Wrong Answer"
      #---------Question 13-------
                                                                                                                                      display dialog "_____ proposed the Albany Plan of Union" buttons {"George Washingon", "Ben Franklin", "John Hancock"}
                                                                                                                                      set A13 to (button returned of the result)
                                                                                                                                      if A13 is "Ben Franklin" then
                                                                                                                                                do shell script "say -v samantha Correct Answer"
                                                                                                                                      else
                                                                                                                                                do shell script "say -v samantha Wrong Answer"
      #--------Question 14------
                                                                                                                                                display dialog "The __________ declared that England owned all of North America east of the Mississippi" buttons {"Proclomation of England", "Treaty of Paris", "Pontiac Treaty"}
                                                                                                                                                set A14 to (button returned of the result)
                                                                                                                                                if A14 is "" then
                                                                                                                                                          do shell script "say -v samantha Correct Answer"
                                                                                                                                                else
                                                                                                                                                          do shell script "say -v samantha Wrong Answer"
      #-------Question 15-------
                                                                                                                                                          display dialog "Braddock was sent to New England so he could ______" buttons {"Command an attack against French", "Scalp the French", "Kill the colonists"}
                                                                                                                                                          set A15 to (button returned of the result)
                                                                                                                                                          if A15 is "Command an attack against French" then
                                                                                                                                                                    do shell script "say -v samantha Correct Answer"
                                                                                                                                                          else
                                                                                                                                                                    do shell script "say -v samantha Wrong Answer"
      #------TheLolQuestion-----
                                                                                                                                                                    display dialog "____ is the name of the teacher who runs this class." buttons {"Mr.White", "Mr.John", "Paul Revere"} default button 1
                                                                                                                                                                    set LOOL to (button returned of the result)
                                                                                                                                                                    if LOOL is "Mr.White" then
                                                                                                                                                                              do shell script "say -v samantha Congratulations…you…have…common…sense"
                                                                                                                                                                    else
                                                                                                                                                                              do shell script "say -v alex Do…you…have…eyes?"
                                                                                                                                                                              #------END------
                                                                                                                                                                              display dialog "I hope you enjoyed the quiz!" buttons {"I did!", "It was horrible"}
                                                                                                                                                                              set endmenu to (button returned of the result)
                                                                                                                                                                              if endmenu is "I did!" then
                                                                                                                                                                                        do shell script "say -v samantha Your awesome"
                                                                                                                                                                              else
                                                                                                                                                                                        do shell script "say -v alex Go outside and run a lap"
                                                                                                                                                                              end if
                                                                                                                                                                    end if
                                                                                                                                                          end if
                                                                                                                                                end if
                                                                                                                                      end if
                                                                                                                            end if
                                                                                                                  end if
                                                                                                        end if
                                                                                              end if
                                                                                    end if
                                                                          end if
                                                                end if
                                                      end if
                                            end if
                                  end if
                        end if
              end if
    end if

    Use code such as:
    display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
    set A1 to (button returned of the result)
    if A1 is "Apprentices" then
    do shell script "say -v samantha Correct Answer"
    else
    do shell script "say -v samantha Wrong Answer"
    return
    end if
    #----------Question 2--------
    display dialog "Most children were taught to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
    set A2 to (button returned of the result)
    if A2 is "Bible" then
    do shell script "say -v samantha Correct Answer"
    else
    do shell script "say -v samantha Wrong Answer"
    return
    end if
    (90444)

Maybe you are looking for

  • How can you tell what version of Secutity update is installed.

    I have osx 10.8.5. Software update says I have security update 2014-001 1.0 available for my Mac. When I try to install, it downloads, says to restart, which I do, and then gives me an error message saying the update can't be installed and to contact

  • Custom infotype display in ESS ERP 2004

    Hi gurus, The personal information infortype and address infotype of the system has custom fields. In ESS for ERP2004 how do I display these fields in the personal information and address iViews. I guess these do not come by default. Then how do we g

  • CS4 Soundbooth Mac won't run

    Installing the CS4 Soundbooth goes fine on Leopard/Intel, then on 1st run it says needs to download some codecs and that fails after about 25% or so. Then it starts normally and a few seconds later when the full SB interface is open, it just hard cra

  • MacBook Pro freezes when battery powerd. Help pls

    Hello There. I have noticed that, when in battery power and Itunes open, my Mac freezes. I have read some of the threads regarding wifi, but in my case I am 100% sure it only occurs on Battery power. Please help me out Itunes 7.3.1

  • Creating OCR from LiveCycle PDFs

    When trying to OCR from Livecycle PDFS, I understand they are part of the designer suite for Adobe products and that they contain "interactive" forms and business information that usually contain sensitive information such as PII / PCA data.  I'm tol