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.

Similar Messages

  • I need help figuring out what is wrong with my Macbook Pro

    I have a mid 2012 Macbook Pro with OS X Mavericks on it and for the past few weeks it has running VERY SLOW! I have no idea what is wrong with it, i have read other discussion forums trying to figure it out on my own. So far i have had no luck in fixing the slowness. When i open applications the icon will bounce in dock forever before opening and then my computer will freeze with the little rainbow wheel circling and circling for a few minutes... and if i try to browse websites it take forever for them to load or youtube will just stop working for me. Everything i do, no matter what i click, the rainbow wheel will pop up! The only thing i can think of messing it up was a friend of mine plugging in a flash drive a few weeks ago to take some videos and imovie to put on his Macbook Pro, he has said his laptop has been running fine though... so idk if that was the problem. Anyways, could someone please help me try something? Thank you!!

    OS X Mavericks: If your Mac runs slowly?
    http://support.apple.com/kb/PH13895
    Startup in Safe Mode
    http://support.apple.com/kb/PH14204
    Repair Disk
    Steps 1 through 7
    http://support.apple.com/kb/PH5836
    Reset SMC.     http://support.apple.com/kb/HT3964
    Choose the method for:
    "Resetting SMC on portables with a battery you should not remove on your own".
    Increase disk space.
    http://support.apple.com/kb/PH13806

  • Need help figuring out what's wrong with my code!

    I am having a few problems with my code and can't see what I've done wrong. Here are my issues:
    #1. My program is not displaying the answers to my calculations in the table.
    #2. The program is supposed to pause after 24 lines and ask the user to hit enter to continue.
    2a. First, it works correctly for the first 24 lines, but then jumps to every 48 lines.
    2b. The line count is supposed to go 24, 48, etc...but the code is going from 24 to 74 to 124 ... that is NOT right!
    import java.text.DecimalFormat; //needed to format decimals
    import java.io.*;
    class Mortgage2
    //Define variables
    double MonthlyPayment = 0; //monthly payment
    double Principal = 200000; //principal of loan
    double YearlyInterestRate = 5.75; //yearly interest rate
    double MonthlyInterestRate = (5.75/1200); //monthly interest rate
    double MonthlyPrincipal = 0; //monthly principal
    double MonthlyInterest = 0; //monthly interest
    double Balance = 0; //balance of loan
    int TermInYears = 30; //term of loan in yearly terms
    int linecount = 0; //line count for list of results
    // Buffered input Reader
    BufferedReader myInput = new BufferedReader (new
    InputStreamReader(System.in));
    //Calculation Methods
    void calculateMonthlyPayment() //Calculates monthly mortgage
    MonthlyPayment = Principal * (MonthlyInterestRate * (Math.pow(1 + MonthlyInterestRate, 12 * TermInYears))) /
    (Math.pow(1 + MonthlyInterestRate, 12 * TermInYears) - 1);
    void calculateMonthlyInterestRate() //Calculates monthly interest
    MonthlyInterest = Balance * MonthlyInterestRate;
    void calculateMonthlyPrincipal() //Calculates monthly principal
    MonthlyPrincipal = MonthlyPayment - MonthlyInterest;
    void calculateBalance() //Calculates balance
    Balance = Principal + MonthlyInterest - MonthlyPayment;
    void Amortization() //Calculates Amortization
    DecimalFormat df = new DecimalFormat("$,###.00"); //Format decimals
    int NumberOfPayments = TermInYears * 12;
    for (int i = 1; i <= NumberOfPayments; i++)
    // If statements asking user to enter to continue
    if(linecount == 24)
    System.out.println("Press Enter to Continue.");
    linecount = 0;
    try
    System.in.read();
    catch(IOException e) {
    e.printStackTrace();
    else
    linecount++;
    System.out.println(i + "\t\t" + df.format(MonthlyPrincipal) + "\t" + df.format(MonthlyInterest) + "\t" + df.format(Balance));
    //Method to display output
    public void display ()
    DecimalFormat df = new DecimalFormat(",###.00"); //Format decimals
    System.out.println("\n\nMORTGAGE PAYMENT CALCULATOR"); //title of the program
    System.out.println("=================================="); //separator
    System.out.println("\tPrincipal Amount: $" + df.format(Principal)); //principal amount of the mortgage
    System.out.println("\tTerm:\t" + TermInYears + " years"); //number of years of the loan
    System.out.println("\tInterest Rate:\t" + YearlyInterestRate + "%"); //interest rate as a percentage
    System.out.println("\tMonthly Payment: $" + df.format(MonthlyPayment)); //calculated monthly payment
    System.out.println("\n\nAMORTIZATION TABLE"); //title of amortization table
    System.out.println("======================================================"); //separator
    System.out.println("\nPayment\tPrincipal\tInterest\t Balance");
    System.out.println(" Month\t Paid\t\t Paid\t\tRemaining");
    System.out.println("--------\t---------\t--------\t-------");
    public static void main (String rgs[]) //Start main function
    Mortgage2 Mortgage = new Mortgage2();
    Mortgage.calculateMonthlyPayment();
    Mortgage.display();
    Mortgage.Amortization();
    ANY help would be greatly appreciated!
    Edited by: Jeaneene on May 25, 2008 11:54 AM

    From [http://developers.sun.com/resources/forumsFAQ.html]:
    Post once and in the right area: Multiple postings are allowed, but they make the category lists longer and create more email traffic for developers who have placed watches on multiple categories. Because of this, duplicate posts are considered a waste of time and an annoyance to many community members, that is, the people who might help you.

  • Need help, no idea what's wrong...

    Hi, ummm i'm really not expierenced with this computer stuff... all I know is I hadn't used my ipod mini in a while and I updated the software for itunes/quicktime. Now itunes seems to work fine, but everywhere quicktime should run stuff... it just gives the q with a question mark...
    I have read the other posts that are a little like mine, but the answers don't make any sense...
    I'm not very computer literate, so if anyone can help can you please use terms I would understand... Oh I also tried unistalling quicktime and installing it by itself... that didn't seem to help anything...
    Thanks so much!!!
    Windows XP   Windows XP  

    I really don't know why it's not working for you. Can you post a website where your getting this?
    Firefox>Tools>Options>Downloads>Plug-Ins
    Is a firewall blocking
    Does the version of Flash Player need to be updated
    http://www.macromedia.com/software/flash/about/
    Or check out Flash Player knowledge base
    http://kb.mozillazine.org/Macromedia_Flash

  • Hi! My notebook had to be fixed and I lost everything. I´ve downloaded iTunes and, of course, it´s empty. What happens if I sync my Ipod nano? Will I loose all music that is in my ipod? Need help, please! What should I do to keep my music?

    Hi!
    My notebook had to be fixed and I´ve lost everything. I´ve downloaded iTunes and, of course, it´s empty. What happens if Isync my Ipod Nano? Will I loose all music that is in my Ipod? Need help, please! What should I do to keep my music? What should I do to transfer the music in the Ipod to itunes?
    Thanks!!!

    How to use your iPod to move your music to a new computer

  • 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

  • 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"

  • Really need help on finding whats wrong with my internet please

    Ok I now have Sky BB (not fibre normal). I have a black Sky hub, connected to my Apple Time Capsule (the flat type, think its 3rd Gen), the TC is in bridge mode, the Sky hub has wireless switched off.
    I also use Powerline adapters from the TC to my iMac, also use numerous WiFi devices, iPhones, Apple TVs, iPads etc.
    I keep getting intermittent "blips", drop outs, no connection, slow use etc, and I just can't get to the bottom of it. Really really appreciate some solid advice and help. Overtime its dropped (or I think it is), I can check Airport utility on my iPhone or iMac and shows all green, and internet connected, physically iy shows green to. The sky hi also shows connection on the hub, and if I goto the home page.
    I've just had a drop/connection loss now, I've been into the logs on sky hub and nothing is shown, only form yesterday. I can't check the TC logs now, I have the old Airport utility that did used to show you, but it won't open now on 10.10.3.
    I've reset powerline etc, but it doesn't seem to be that, as although iPhone shows connected to WiFi it doesnt connect to internet.
    I believe the actual Sky end is ok, I goto into the sky hub home page 192.168.0.1, and shows connected, Sky have ran tests etc and all seems ok. What I'm wondering is if its the TC? I've had a few times now where the TC says has to restart backup as been a problem
    thanks

    Why down grade the firmware? What will that do/give me?
    On the older units i find the earlier firmware more reliable.. The 7.6.4 introduced a number of new functions that work poorly on older AE and TC so it is simple to revert to older firmware and see..
    It is a 3min exercise.. and might do nothing.. but you are trying to prove where an issue is.. this is part of that testing.
    If I factory restore what will that do? I take it I can't use the backup settings to restore afterwards?
    All routers need the occasional reset. Wrong settings creep in.. and particularly in situations where there is power outages or OS that works poorly (read Yosemite) then strange and wonderful things happen.
    A backup of settings is only useful if it was taken before the problems started.. did you?? If not forget it and configure from scratch.. that is a key part of getting things to work.
    Not sure what is meant by the use LAN port instead, thought I had to use the WAN if I connect it to my Sky hub?
    When the TC is bridged.. it has no WAN port. There is no routing.. but I have found the LAN ports are more reliable than the WAN port.
    With you saying about "only lasts a while" is it worth buying a new shape one refurbished from Apple? Are the newer shape any better reliability?
    I would not buy a refurbished.. I doubt this model is understood very well and its issues happen in some situations and not others.. I think a lot of them are put back in stock without any sort of repair. They are tested .. found working and hence resold.. but the situation in people's homes is not a test lab. When people connect them to modems and routers that the device has issues with it fails again.
    I find it hard to recommend the new one.. especially as it has now been out more than a year.. and firmware has not improved.
    It is about refresh time and I would wait to see if a new one is coming.
    If you need wireless buy a wireless router.. if you need backup use a local USB drive.
    Repair of the TC is complicated.
    See https://sites.google.com/site/lapastenague/a-deconstruction-of-routers-and-modem s/apple-time-capsule-repair/new-issue-with-a1355-gen-3-tc
    I figured this out long ago so they were already showing up with issues within 3 years.. if you get 4 or more years out of modern equipment.. that is beyond its design lifespan.

  • Getting started with C# need help to know what I need to learn

    Good evening everybody, first time posting in this forum, so be gentle with my lack of knowledge about C#.
    A bit about me first, I'm a electronics student, with a strong C/C++ knowledge but geared toward micro-controllers(namely AVR's, PSoC and ARM Cortex-M3), now I want to make some nice GUI's for some electronic widgets and my main OS is Windows and
    C# seems to fit the bill for what I need to do, that is basic GUI's, serial com's and some graphing features do display simples x/y graphs.
    So, I'm in the process of designing a two stroke ignition system and I want to make a easy to use interface to re-program and visualize the ignition curve and some other parameters, so a simples program I think.
    My main idea/design is more or like the program made by the Ignitech company, I will post some example images so I can explain my self better. 
    The first picture shows the principal window for me, its a simple graph that is driven by the two tables that are over th graph, I would prefer to have a dynamic table(for example show only 8 positions or 10 ou 12, driven by another input box), and then
    the graph, and a couple tabs, in part so I can configure multi-curve ignitions, and to have a couple different "main" tabs, main configuration, the advance designer tab and a monitor tab(shown in the second picture).
    What I'm seeking is what functions/methods should I study and use to achieve this?
    I think I should say that I'm not copying anything from Ignitech, much less trying to make a "pirate" version of their software(its a free direct download from their site), its just a personal project.
    Best regards and thanks in advance.
    EDIT: For now I cannot post pictures(and links I assume), hope you guys and girls can get the mental image.

    Hi
    Keeepcool,
    I am sorry to tell you that this forum is only covering the C# programming language, IDE, libraries, samples, and tools. Since your issue is not clear to us. I will move your thread to "off-topic " forum. If you have any others issues about C#,
    Please feel free to post in this forum. Thanks for your understading.
    Best Wishes!
    Kristin
    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.

  • 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

  • Need help in some what complex transpose of data...

    Dear Team,
    I need a small help, to transpose the data...
    The Input data is shown below...
    Product
    Level
    Position
    Route
    1st_Prod_id
    Request_Flag
    Qty
    99904228
    LEVEL_1
    1
    1
    828452
    Y
    0
    96500436
    LEVEL_2
    2
    1
    828452
    N
    1
    96500437
    LEVEL_2
    3
    1
    828452
    N
    1
    96500437
    LEVEL_3
    4
    1
    828452
    N
    2
    66500084
    LEVEL_3
    5
    1
    828452
    Y
    0
    67653972
    LEVEL_3
    6
    1
    828452
    N
    2
    47418545
    LEVEL_4
    7
    1
    828452
    Y
    0
    47418545
    LEVEL_5
    8
    1
    828452
    N
    0
    35264043
    LEVEL_5
    9
    1
    828452
    N
    2
    37411616
    LEVEL_5
    10
    1
    828452
    N
    0
    35264044
    LEVEL_6
    11
    1
    828452
    Y
    2
    The output format is shown below along with transpose logic...
    Dmd_Product
    From_Prod
    From_Level
    To_Prod
    To_Level
    Total_QtY
    99904228
    99904228
    LEVEL_1
    66500084
    LEVEL_3
    4
    99904228
    66500084
    LEVEL_3
    47418545
    LEVEL_4
    2
    99904228
    47418545
    LEVEL_4
    35264044
    LEVEL_6
    4
    1. Depending upon the Req_Flag = 'Y', we have to identify our from_product - to_product, & from_level - to_level...
    2. Between from_product - to_product we have to sum up the quantity (QTY)
    3. The position 1 product should remain as it throught out the transformation and shown under new column Dmd_Prod
    4. Between Position 1 and Position 5 we have 2 Req_Flag --> One req_flag = 'Y' at pos = 1 and another req_flag = 'Y' at pos = 5
       So my From_Product will be product as pos = 1 and to_product will be product at pos = 5...
    5. The same iteration goes on and my product at pos = 5 becomes my from_product and another item at pos = 7 becomes to_product... and so on...
    I hope i am clear in my explanation...
    please give me some hints or tips how to solve it...
    Attached is the create table statement for sample data...
    Create Table test As
    (Select 99904228 prod, 'LEVEL_1' l_level, 828452 first_prod_id,  1 position,  1 route, 'Y' req_flag, 0 qty From dual Union All 
    Select 96500436 prod, 'LEVEL_2' l_level, 828452 first_prod_id,  2 position,  1 route, 'N' req_flag, 1 qty From dual Union All
    Select 96500437 prod, 'LEVEL_2' l_level, 828452 first_prod_id,  3 position,  1 route, 'N' req_flag, 1 qty From dual Union All
    Select 96500437 prod, 'LEVEL_3' l_level, 828452 first_prod_id,  4 position,  1 route, 'N' req_flag, 2 qty From dual Union All
    Select 66500084 prod, 'LEVEL_3' l_level, 828452 first_prod_id,  5 position,  1 route, 'Y' req_flag, 0 qty From dual Union All
    Select 67653972 prod, 'LEVEL_3' l_level, 828452 first_prod_id,  6 position,  1 route, 'N' req_flag, 2 qty From dual Union All
    Select 47418545 prod, 'LEVEL_4' l_level, 828452 first_prod_id,  7 position,  1 route, 'Y' req_flag, 0 qty From dual Union All
    Select 47418545 prod, 'LEVEL_5' l_level, 828452 first_prod_id,  8 position,  1 route, 'N' req_flag, 0 qty From dual Union All
    Select 35264043 prod, 'LEVEL_5' l_level, 828452 first_prod_id,  9 position,  1 route, 'N' req_flag, 2 qty From dual Union All
    Select 37411616 prod, 'LEVEL_5' l_level, 828452 first_prod_id,  10 position, 1 route, 'N' req_flag, 0 qty From dual Union All
    Select 35264044 prod, 'LEVEL_6' l_level, 828452 first_prod_id,  11 position, 1 route, 'Y' req_flag, 2 qty From dual
    Regards
    nic..

    Maybe
    select dmd_product,
           from_product,
           from_level,
           to_product,
           to_level,
           total_qty,
           agg_yield
      from (select position,
                   dmd_product,
                   case when to_flag = 'Y' and lag(from_flag,1) over (order by position) = 'Y'
                        then lag(from_product,1) over (order by position)
                   end from_product,
                   case when to_flag = 'Y' and lag(from_flag,1) over (order by position) = 'Y'
                        then lag(from_level,1) over (order by position)
                   end from_level,
                   to_product,
                   to_level,
                   total_qty,
                   case when total_qty is not null
                        then yield
                   end agg_yield
              from (select position,
                          first_value(dmd_product ignore nulls) over (order by position) dmd_product,
                          from_product,
                          from_level,
                          to_product,
                          to_level,
                          case to_flag when 'Y'
                                       then total_qty -
                                            lag(total_qty,1) over (order by position) +
                                            lead(qty,1) over (order by position)
                          end total_qty,
                          case when to_flag = 'Y'
                                and lead(to_flag,1) over (order by position) = 'N'
                               then yield
                               else yield * lead(yield,1) over (order by position) / 100
                          end yield,
                          from_flag,
                          to_flag
                     from (select position,
                                  case when req_flag = 'Y'
                                        and position = (select min(position)
                                                          from test
                                                         where req_flag = 'Y'
                                       then prod
                                  end dmd_product,
                                  prod from_product,
                                  l_level from_level,
                                  req_flag from_flag,
                                  lead(prod,1) over (order by position) to_product,
                                  lead(l_level,1) over (order by position) to_level,
                                  lead(req_flag,1) over (order by position) to_flag,
                                  qty,
                                  sum(qty) over (order by position) total_qty,
                                  last_value(nullif(yield,100) ignore nulls) over (order by position) yield
                             from test
                    where from_flag != 'N'
                       or to_flag != 'N'
             where dmd_product is not null
    where from_product is not null
    order by position
    DMD_PRODUCT
    FROM_PRODUCT
    FROM_LEVEL
    TO_PRODUCT
    TO_LEVEL
    TOTAL_QTY
    AGG_YIELD
    99904228
    99904228
    LEVEL_1
    66500084
    LEVEL_3
    4
    92
    99904228
    66500084
    LEVEL_3
    47418545
    LEVEL_4
    2
    90
    99904228
    47418545
    LEVEL_4
    35264044
    LEVEL_6
    4
    97.02
    Regards
    Etbin

  • I dont  understand my plan i have applied data 4 times this week and each time it says insufficent funds i need help to know what plan to have and how to manage my data my phone is currently in insufficent status as of this morning i refilled it last nigh

    can anyone help me with knowing how to live chat with customer service

    I think you need to contact your bank....

Maybe you are looking for