Script smart question

1)how will a script will be printed in runtime .what are the task abaper shd do for that.
2)if a program has 15 break points ..how to directly reach the 15 th break point.
3)how a vendor analysis report will be generated .

2)if a program has 15 break points ..how to directly reach the 15 th break point
It is not possible to reach directly to go 15th break point unless you delete you delete 14 break points.
how will a script will be printed in runtime .what are the task abaper shd do for that.
Layout will trigger in transaction wise mostly,ABAPER will work modification of standar scripts i mean you need copy the layout into Zlayout and do the modificatio.
modification will be attaching company logo,Changing footer window like we will keep Terms and condition ,adding fields into main window.
Developer will not create output type,output type will be creating bu Functional consultant.
3)how a vendor analysis report will be generated
See the below example code :
Tables : ekko,
         ekpo,
         konp,
         a016.
*&Data Decleration
Data : v_pos type i value 19.
Data : begin of it_rfq occurs 0,
        ebeln type ekko-ebeln,
        ekorg type ekko-ekorg,
        lifnr type ekko-lifnr,
        matnr type ekpo-matnr,
        WERKS type ekpo-WERKS,
       end of it_rfq.
Data : begin of it_a016 occurs 0,
        ebeln type ekko-ebeln,
        knumh type knumh,
       end of it_a016.
Data : begin of it_a363 occurs 0,
        werks type werks,
        lifnr type lifnr,
        matnr type matnr,
        knumh type knumh,
       end of it_a363.
Data : begin of it_pr_details occurs 0,
        knumh type knumh,
        kschl type kschl,
        kbetr type kwert,
       end of it_pr_details.
Data : begin of it_final occurs 0,
        ebeln type ebeln,
        lifnr type lifnr,
        name1 type lfa1-name1,
        pb00  type kbetr,
        zpac  type kbetr,
        zb00  type kbetr,
        ZIN1  type kbetr,
        JEC1  type kbetr,
        JHX1  type kbetr,
        JMOP  type kbetr,
        JMX1  type kbetr,
        JMX3  type kbetr,
        JSEP  TYPE KBETR,
        JVRD  type kbetr,
       end of it_final.
Data : begin of it_vendorname occurs 0,
        lifnr type lifnr,
        name1 type lfa1-name1,
       end of it_vendorname.
*&Selection Screen
Selection-screen: begin of block blk1 with frame title text-001.
  parameters     : p_matnr like ekpo-matnr obligatory.
  select-options : s_ebeln for ekko-ebeln,
                   s_ekorg for ekko-ekorg,
                   s_lifnr for ekko-lifnr.
Selection-screen: end of block blk1.
*&Start-of-Selection.
Start-of-selection.
  Select ekko~ebeln
         ekko~ekorg
         ekko~lifnr
         ekpo~matnr
         ekpo~werks
    into table it_rfq
    from ekko
   inner join ekpo
      on ekkoebeln eq ekpoebeln
    where ekko~ebeln in s_ebeln
      and ekko~ekorg in s_ekorg
      and ekko~lifnr in s_lifnr
      and ekpo~matnr eq p_matnr
      and ekko~bstyp eq 'A'.
  if sy-subrc eq 0.
*--> Condition number from A tables.
  Perform get_connum.
*--> Getting the Pricing Details from Konp Table.
  Perform get_prices.
*--> Populate Vendor Name.
  Perform pop_vendor_name.
*--> Populating the Final Internal table for Report.
  Perform pop_final_tab.
  else.
   message 'Purchase Document does not exist' type 'E'.
  endif.
*&End-of-Selection.
End-of-Selection.
write :/ sy-vline,
       2 'Vendor Number',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 1.
  write at v_pos it_final-lifnr.
  v_pos = v_pos + 35.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'Gross Price',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-pb00.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'Packing & Forward',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-zpac.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'Surcharge',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-zb00.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'Installation',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-zin1.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'Ed cess on BED%',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-jec1.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'A/P Secess set off',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-jhx1.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'Basic Excise Duty',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-zpac.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'A/P BED set off',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-jmx1.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'Ecess % set off',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-jmx3.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'Sec ED Cess on BED',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-jsep.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
write :/ sy-vline,
       2 'VAT%',
       19 sy-vline.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 20.
  write at v_pos it_final-jvrd.
  v_pos = v_pos + 16.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
*&Top-of-Page.
Top-of-Page.
format color 1.
Write: 'Material Number :' color 1, p_matnr color 1.
loop at it_final.
  v_pos = v_pos + 1.
  v_pos = v_pos + 35.
endloop.
write at: /(v_pos) sy-uline,/ sy-vline,2 'Vendor Name'.
v_pos = 19.
loop at it_final.
  write at v_pos sy-vline.
  v_pos = v_pos + 1.
  write at v_pos it_final-name1.
  v_pos = v_pos + 35.
endloop.
write at: v_pos sy-vline,
          /(v_pos) sy-uline.
*&      Form  get_connum
      Condition number from A tables
form get_connum .
    Select EVRTN
           knumh
      from a016
      into table it_a016
       for all entries in it_rfq
     where EVRTN eq it_rfq-ebeln.
    Select werks
           lifnr
           matnr
           knumh
      from a363
      into table it_a363
       for all entries in it_rfq
     where werks eq it_rfq-werks
       and lifnr eq it_rfq-lifnr
       and matnr eq it_rfq-matnr.
endform.                    " get_connum
*&      Form  get_prices
      Getting the Pricing Details from Konp Table.
form get_prices .
  if not it_a016[] is initial.
    select knumh
           kschl
           kbetr
      from konp
      into table it_pr_details
       for all entries in it_a016
     where knumh eq it_a016-knumh.
  endif.
  if not it_a363[] is initial.
    select knumh
           kschl
           kbetr
      from konp
appending table it_pr_details
       for all entries in it_a016
     where knumh eq it_a016-knumh.
  endif.
endform.                    " get_prices
*&      Form  pop_final_tab
      Populating the Final Internal table for Report
form pop_final_tab .
data : l_subrc like sy-subrc.
  sort it_a016 by ebeln.
  loop at it_rfq.
    clear l_subrc.
    read table it_a016 with key ebeln = it_rfq-ebeln
    binary search.
    if sy-subrc eq 0.
      loop at it_pr_details where knumh eq it_a016-knumh.
        it_final-ebeln = it_rfq-ebeln.
        it_final-lifnr = it_rfq-lifnr.
        read table it_vendorname with
        key lifnr = it_rfq-lifnr.
        it_final-name1 = it_vendorname-name1.
        case it_pr_details-kschl.
        when 'PBOO'.
          it_final-pb00 = it_pr_details-kbetr.
          if it_pr_details-kbetr eq 0.
           clear it_final.
           continue.
          endif.
        when 'ZPAC'.
          it_final-zpac = it_pr_details-kbetr.
        when 'ZB00'.
          it_final-ZB00 = it_pr_details-kbetr.
        when 'ZIN1'.
          it_final-ZIN1 = it_pr_details-kbetr.
        endcase.
      endloop.
    else.
      l_subrc = sy-subrc.
    endif.
    read table it_a363 with key lifnr = it_rfq-lifnr
                                werks = it_rfq-werks
                                matnr = it_rfq-matnr.
    if sy-subrc eq 0.
      loop at it_pr_details where knumh eq it_a016-knumh.
        it_final-ebeln = it_rfq-ebeln.
        it_final-lifnr = it_rfq-lifnr.
        read table it_vendorname with
        key lifnr = it_rfq-lifnr.
        it_final-name1 = it_vendorname-name1.
        case it_pr_details-kschl.
        when 'JEC1'.
          it_final-JEC1 = it_pr_details-kbetr.
        when 'JHX1'.
          it_final-JHX1 = it_pr_details-kbetr.
        when 'JMOP'.
          it_final-JMOP = it_pr_details-kbetr.
        when 'JMX1'.
          it_final-JMX1 = it_pr_details-kbetr.
        when 'JMX3'.
          it_final-JMX3 = it_pr_details-kbetr.
        when 'JSEP'.
          it_final-JSEP = it_pr_details-kbetr.
        when 'JVRD'.
          it_final-JVRD = it_pr_details-kbetr.
        endcase.
      endloop.
    elseif l_subrc ne 0.
   continue.
    endif.
    append it_final.
    clear  it_final.
  endloop.
endform.                    " pop_final_tab
*&      Form  pop_vendor_name
      Populate Vendor Name
form pop_vendor_name .
  if not it_rfq[] is initial.
  Select lifnr
         name1
    from lfa1
    into table it_vendorname
   where lifnr eq it_rfq-lifnr.
  endif.
endform.                    " pop_vendor_name
Reward Points if it is helpful
Thanks
Seshu

Similar Messages

  • I keep getting error messages that a script "may have stoped responding", The script in question is "contentAreaUtils.js".

    I just updated to FireFox v3.6.8, after using v3.5 successfully for many months. With the new version I keep getting error messages that a script "may have stopped responding", The script in question is "contentAreaUtils.js". My OS is Win2k SP4, with 253,424 KB RAM.
    Is there a known fix. If not, is there an easy way to revert to FireFox v3.5 ?

    Attached is an image of the error message.

  • Can send me recent real time sap script interivew question?

    Hi any one plz send me the real time sap script interivew questions... or mail me on [email protected]

    Hi,
    Please check the links,
    http://www.sap-img.com/sapscripts/faq-for-sap-scripts.htm
    FAQ on Scripts
    If this data isn't enough, then you can search for SAP script interview questions in SDN, you get more results.
    Regards,
    Hema.
    Reward points if it is useful.

  • README: Asking smart questions!

    Before posting on these boards please read the following article, it could save you a lot of trouble!
    http://www.catb.org/~esr/faqs/smart-questions.html

    About the link howto ask questions: I think the whole self image of alot of hackers and acctually alot of these are wannabe hackers are wrong and elitistic. Thinking the world spins only around them because they know and have information about things in the small universe of computer sience. This is ofcourse not only a problem in computer sience but generelly a problem for mankind in all areas of life. Not to say stupid questions feel hard to answer, but i dont  think they deserve a harsh answer in any way if they are just stupid and not ignorant. There is a dark side and dark culture in this,  it has alot of explantions ofc. Some come from Computer sience in late 70 and begining of 80 being togheter with video games etc as culture revolution from young people without alot of life experience, anyways i was one of them. Thinking i knew everything because i could c. Unfortunaly this selfimage lives on in generations and in computer culture on irc, the web etc. Well i suppose better then these people go out and drink and drive or something. (and ofc its not allways young people. just an ex of where  a subculture came from)  ....ramblings...ramblings..
    On a  sidenote, there are ofc ways you should ask questions and th elink gives alot of valid pointers. I only disagree on the whole "all that matters are the (wannabe)hackers point of view". Most cases there is no reason to be harsh. sorry for offtopic.
    Last edited by Mazon (2008-08-20 07:27:14)

  • Sending emails in PDF & TXT format generated by SAP script/Smart forms

    Hi
    We have a requirement to configure SMTP node to send emails in PDF & TXT format. Currently, Output format for SAP Documents generated by SAP Script/Smart Forms configured in PDF. (Tx - SCOT - SMTP Node - Intetnet - Output Forms for SAP Documents). But, We also like to send emails in TXT format for other application in the same system. I see that you can send emails generated by SAP Script/Smart Forms either in PDF or TXT format not both.
    Is it possible to send the emails in both the formats by configuring in Tx SCOT?
    Your inputs will be appreciated.
    Regards
    Chandu

    Hi chandu,
    1.  emails in both the formats by configuring in Tx SCOT ?
      Scot will allow only ONE AT A TIME.
    2. The other workaround is,
      that using some FM
      convert the OTF (sapscript/smartform)
      data to TEXT,
      and send it as RAW
    3. Configure RAW =  TEXT in scot.
    regards,
    amit m.

  • Problems in sap script/smart forms

    what are the major problems will come in real time about smart form and sap script?

    Hi there.
    Question 1:
    Use font MICR_C for MICR CMC-7 or MICR_E for MICR E-13B
    http://help.sap.com/saphelp_nw04/helpdata/en/90/78f078030211d399b90000e83dd9fc/frameset.htm
    Question 2:
    /: SET DATE MASK = 'DDMMYYYY'
    http://help.sap.com/saphelp_nw04/helpdata/en/d1/8034d4454211d189710000e8322d00/frameset.htm
    Question 3:
    /E BOX_ELEMENT
    /: POSITION WINDOW                       
    /: POSITION YORIGIN &Y& LN 
    /: SIZE HEIGHT &HEIGHT& LN    
    /: BOX FRAME 10 TW
    /: BOX XPOS  '0.0' CM  WIDTH 0 TW FRAME 10 TW
    Question 4:
    &symbol(C)&
    http://help.sap.com/saphelp_nw04/helpdata/en/d1/8034d4454211d189710000e8322d00/frameset.htm
    Question 5:
    See SAP Note 129581.
    Best regards.
    Valter Oliveira.
    Edited by: Valter Oliveira on May 30, 2008 4:42 PM

  • SAP Script & Smart forms

    Hi All,
    How to find out in a particular object whether SAP scripts or smart forms are used?
    If forms are used is there any t.code to find out which type of form is used?
    Regards,
    Vamsi P

    Hello Vamsi,
    <b>SAP scripts and SMARTFORMS - both serve the same purpose.</b>
    SMARTFORMS were introduced since the release of SAP 4.7. Earlier to that it was only SAP scripts for designing layouts. SMARTFORMS have few additional benefits in terms designing over scripts.
    Now, coming to your questions -  Every Script or a SMARTFORM has a driver program. i.e. Smart form/Script has to be called into a program. And this Driver program is in turn assigned to the relevant output type, And the output type is assiged to appropriate level of a transaction i.e. at the header level of an order or invoice etc.
    T-code: SE71 is used to design SAP script.
    T-Code: SMARTFORMS is used for designing Smart Forms.
    To find out whether a script or Smartform is used in any particular case..........you have to look into the <b>Driver program</b> that is assiged to the output type.
    Hope this helps..............
    <b>REWARD POINTS IF HELPFUL.</b>
    Regards
    Sai

  • [JS][CS3] Script deployment question

    Hi everyone,
    I am currently writing scripts in a corporate environment (~30 users), and I'm contemplating the easiest and most efficient way of deploying the scripts. We have a couple of scripts already with the users that are located locally on their machines. As time goes on we'll be writing more and more scripts and updating the existing ones as necessary.
    My current inclination is to stop saving the files locally on the individual machines and instead put a shortcut to a shared server folder in the scripts folder instead. In my testing it seems to work fine without any significant delay, and it automatically populates all of the files in linked folder. I basically want to be able to make sure that users are always launching the most up-to-date code and that any future scripts can be easily deployed without me walking around to everyone's desk (or worse, e-mailing instructions and hoping for the best).
    Are there any downsides/performance issues to this approach? It's a strictly desktop environment, so I don't have to worry about laptop users who are not connected to the network. Is there an alternate way that would be smoother?
    Thanks!

    We've tried it both ways. On our 12 InCopy machines (OSX), we have a symbolic link from /Applications/Adobe InCopy CS5/Scripts/Scripts Panel/ to a shared folder. This works great as long as our file server doesn't go down, and all sorts of other things would break horribly. And the User scripts folder is still available for any machine-specific customizations.
    For our 4 InDesign machines, we decided that was a little too much risk. So instead we have a script, copyScripts.jsx, that just copies scripts from the file server to the Application scripts folder. So everytime there is a change, we go around to those 4 machines and run copyScripts. This works OK.
    It's a little bit of a pain but it also insulates us a bit from bugs, and it means that whoever is using InDesign can decide to not update the scripts if they are in the middle of something critical. They can choose to defer taking the script updates.
    I think if we had to do it over, we probably wouldn't bother with the copyScripts mechanism. The centralized shared folder works pretty well. But it's not so annoying that we've gotten rid of it. And for 4 machines, it's not a huge burden.
    Also, there are some questions of development. If it's convenient to do development in the ESTK, having the shared folder means you cannot just rightclick in the Scripts panel and choose Edit Script. Or if you do, then any changes you save as you are developing the script are instantly available to everyone, potentially breaking their work if there are problems, or if there is debugging output ,etc., etc. So you need to make sure you do a development in a different place. Just something to keep in mind.

  • Task notification script & smart folks

    Has anybody smarter than me done anything cool with the Task Notification Script at
    /Library/Application Support/Apple/Remote Desktop/Notify
    I have it sending me notification of success and failure. It would be nice if it included info on:
    • reasons for failure
    • successes by machine name or IP addresss
    • failures by machine name or IP address
    • info on pending tasks
    I'm sure you can think of additional items.
    b.

    The sample Notify script in /Library/Application Support/Apple/Remote Desktop shows pretty much what you can expect to achieve though the use of the task notification script.
    It gets passed 2 pieces of data. The task (class) and the final state of the task. The sample script sends an email to a pre-configured user, but you could easily create a version that would append the text to a file, or write out a new file using either defaults or PListBuddy.

  • Script format question: Title over

    Question: In the script format when using a "TITLE OVER" is it a General, Shot or an Action format. Appreciate any input here, thanks.
    Rich

    It a good question, as it is worth thinking how the elements in our screenplays will be used down the line. So for example, although the formatting of making it a Shot certainly would put TITLE OVER in caps, and making it Action would allow the paragraph it is in to be lower and upper case, it better to think how the elements may be used as metadata when you move on from writing, rather than how they look on the page. The tags and elements will be used by others in many different ways as the script moves through the planning and shooting steps.
    Shot elements will be processed by an application like Adobe OnLocation which will create a placeholder shot for it for the shoot. That could be theoretically correct in this case as the title will need to be shot. However to answer your question I think General is the appropriate element, just as the Title and Author are General on the titlle page.
    Are there other elements of the screenplay that will need to be tagged in special ways so they are available as the right kind of metadata later in the production process?

  • [CS3:Mac]Script Runner question...

    Hi,<br /><br />I'm trying to perform a simple test  to run a javascript file in my plugin.<br />My first question is do I need to setup/register/add something in plugin to be able to run a script in plugin? the reason I ask this, i get an error in line:<br />InterfacePtr<IScriptRunner>   scriptRunner(scriptManager,UseDefaultIID()); <br />scriptRunner is always NULL.<br /><br />Does anyone know what is wrong here?<br /><br />this is my code snippet:<br /><br />           PMString      jsFullPath("Volumes/HD1/.../MyJavaScript.jsx");      // a path to my java script file          <br />        do {<br />          const IDFile outFile(jsFullPath); <br />          InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss)); <br />          ASSERT( scriptManager ) ;<br />          if(scriptManager == NULL) {<br />               break;<br />          }<br />          InterfacePtr<IScriptRunner>   scriptRunner(scriptManager,UseDefaultIID()); <br />          ASSERT( scriptRunner ) ;<br />          if(scriptRunner == NULL) {  // ******* Always returns NULL *****************//<br />               break;<br />          }<br />               ...<br />          ...<br />               ...  //set other params here<br /><br />          ErrorCode err = scriptRunner->RunFile(outFile, param,..); <br />     <br />     }while(kFalse);<br /><br />Thanks,<br />Mor

    I'm testing this code with different version of CSx, The code works fine on CS3 version but fails( in a line that I marked) in other version .
    Never mind should be OK on CS3.
    Thanks,

  • Scripting studio questions... - Help!?

    Hello, I've got two questions, both regarding applescript studio.
    Q1: How can one execute applescript code without pressing a button etc.
    Easy example: If I would like to display the default dialog with xcode's applescript, I would write "display dialog". But it doesn't display the default wanted dialog (just the app's window).
    Q2: How do I retrieve every word of a Text view interface component?
    Better asked. I would like to count all the words entered and have every word with a unique value, like the first word have the integer value of 1 the second word 2 the third 3 ...
    Help (of any kind) is dearly appreciated!

    You might be having a problem defining the Text VIew, so I will start from a blank application template.
    Double-click the MainMenu.xib file to open it in *Interface Builder*, then add a Text View to the application window and size it as desired. Clicking in the middle of the Text View will select the Scroll View part, and clicking again near the top will select the Text View part. With the Text VIew selected, go to the AppleScript Inspector, choose the script that you want to use your Text View in and give the Text View a name (for example "myTextView"). You can give names to the other user interface items if desired - in this example there is only one of each item so their indexes can also be used (e.g. "window 1"). Usually a name will be more clear, but I used a couple of different ways to specify the Text View.
    To add some delegate handlers, I selected the *end editing* event handler for the Text View, and the launched event handler for the application (don't forget to set the script). Once everything is defined in Interface Builder, I filled in the event handlers with some log statements to show what is happening (open the Console when build/running the application):
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFCE75;
    overflow: auto;"
    title="this text can be pasted into Xcode 3.1.x (Leopard)">
    on launched theObject
    log "launched..."
    tell window 1
    set contents of text view 1 of scroll view 1 to "This is some testing text - some testing text this is."
    end tell
    display dialog "This is a test dialog"
    end launched
    on end editing theObject
    log "end editing..."
    set theWords to words of (get contents of text view "myTextView" of scroll view 1 of window 1)
    log result
    end end editing
    </pre>
    A test dialog will appear when the application is first run (launched), and pressing return in the Text View (which ends the editing) will log the words of the content to the console.

  • Another script library question

    I had a quesiotn about this and "kel" gave me this suggestion:
    put these in [external script file]:
    property var1 : "VAR1"
    property var22 : "VAR22"
    property var333 : "VAR333"
    then in the actual script, do:
    set f to [external script file]
    set s_lib to load script f
    var22 of s_lib
    This works but there is a problem. I have now hundreds of lines of code with almost 30 variables, occurring dozens of times in the text and to manually find each and every one of them and paste "of s_lib" after them would be just awful.
    So my question is: is there a way to avoid it and simply "#include" the library somehow, like in C++?
      Mac OS X (10.4.8)  

    Hello Asu,
    I'm afraid you've missed an important point on global declaration.
    The point is that the variables imported by the previous 'SCRIPT 2' become global variables in the importer script just as though they were declared as global in importer's implicit run handler. And in order to refer to those global variables from a handler other than implicit or explicit run handler, you have to declare them as global in the handler unless you have declared them as global in the top level of importer script. In this respect, the global declaration in 'handler1()' in 'SCRIPT 2' is mandatory.
    Global variable declared in top level of a script and global variable declared in a handler in a script have different behaviours in regards to their scope. Please peruse the language manual for details:
    cf. pp. 311-323
    'Scope of Script Variables and Properties'
    AppleScriptLanguageGuide.pdf
    By the way, of course you may define a new variable and set it to an imported global variable, but then I think you should lose the only advantage of 'SCRIPT 2' over 'SCRIPT 1', that is no reassignments of variables are needed in 'SCRIPT 2'.
    As for handlers in external script, you'd need more complicated device. See the codes below. 'SCRIPT 1A' and 'SCRIPT 2A' are revised samples for 'SCRIPT 1' and 'SCRIPT 2' respectively. Although I'm posting them here, I don't recommend this sort of coding practice at all. It unnecessarily complicates matters and makes debugging harder. I'd recommend instead the simple and natural approach in AppleScript, that is; to load an external script and to tell it to do its tasks (as kel has explained), that should minimize non-essential dependencies and maxmize modularity (in AppleScript's own fashion).
    Hope this helps,
    H
    PS. 'run' command of AppleScript and 'run script' command in Standard Additions are utterly two things. The latter creates a new instance of script every time it is invoked and hence cannot share the context with caller script in normal means. And I see no reason to use 'run script' where I can use 'run'.
    -- SCRIPT 1A
    (* Import properties *)
    property p1 : {} -- required if it is used in external handler with 'my' possessive. -- [*A]
    property p2 : {} -- idem. -- [*A]
    property pf1 : {} -- mandatory. -- [*A]
    property pf11 : {} -- mandatory. -- [*A]
    main()
    on main()
    set o to load script file "RAM Disk:test:properties.scpt" -- load external script
    set {p1, p2, pf1, pf11} to o's {p1, p2, pf1, pf11}
    return {p1, p2, pf1(), pf11(), handler1()}
    end main
    on handler1()
    return {pf1(), pf11()}
    end handler1
      [A] Alternatively, these properties can be declared as globals as well.
       The point is that they must not be local.
       (Also if the following code were entirely in implicit or explicit run handler,
       no declaration of properties or globals should be required, for they become implicit globals)
    -- external script "properties.scpt" contains following code
    on f1() -- [*1]
    --return f11() -- [*2]
    return pf11() -- [*3]
    end f1
    on f11() -- [*1]
    return (my p1) + (my p2) -- [*4]
    end f11
    property p1 : 1
    property p2 : 2
    property pf1 : f1
    property pf11 : f11
      [1] Handler definitions must precede the definitions of the handler name's properties.
        e.g. f1()'s definition must precede the definition of 'property pf1 : f1'.
      [2] This should fail if f1() is called (via pf1()) in a script that loads this script; e.g.
        -- code of caller
        set o to load script file "path to this script"
        set pf1 to o's pf1
        return pf1() -- this should throw error -1708
        -- end of code of caller
      [3] Always invoke other handler by its 'global' (i.e. 'property') name. cf. [2]
      [4] Possessive 'my' is required to resolve property variable properly in a handler that is
       assigned to a property by itself.
        e.g. 'my p1' is required in 'f11()' when 'p1' is a property and 'f11()' is assigned to a property.
    -- end of "properties.scpt"
    -- END OF SCRIPT 1A
    -- SCRIPT 2A
    (* Import globals *)
    main()
    on main()
    set o to load script file "RAM Disk:test:globals.scpt" -- load external script
    tell o to run
    global g1, g2 -- mandatory -- [*A]
    --global gf1, gf11 -- [*B]
    return {{g1, g2, gf1(), gf11()}, handler1()}
    end main
    on handler1()
    global g1, g2 -- mandatory -- [*C]
    --global gf1, gf11 -- [*B]
    {g1, g2, gf1(), gf11()}
    end handler1
      [A] If the code currently in main() were in implicit or explicit run handler instead,
       no global declaration should be required, for the variables become implicit globals.
      [ B] Not required for 'global' handler name (that are redefined as global in 'globals.scpt').
      [C] Always required in a handler other than implicit or explicit run handler.
    -- external script "globals.scpt" contains following code
    global g1, g2 -- mandatory.
    main()
    on main()
    global gf1, gf11 -- mandatory -- [*1]
    set g1 to 1
    set g2 to 2
    set gf1 to my f1 -- [*2]
    set gf11 to my f11 -- [*2]
    end main
    on f1()
    --return f11() -- [*3]
    return gf11() -- [*4]
    end f1
    on f11()
    return g1 + g2
    end f11
      [1] If the code currently in main() were in implicit or explicit run handler instead,
       no global declaration should be required for handler names, for the variables become implicit globals.
      [2] Possessive 'my' is required to resolve handler name properly in another handler.
       If the code currently in main() were in top level of script (i.e. in implicit run handler) instead,
       'my' possessive should not be required.
      [3] This should fail if f1() is called (via gf1()) in a script that loads this script; e.g.
        -- code of caller
        tell (load script file "path to this script") to run
        return gf1() -- this should throw error -1708
        -- end of code of caller
      [4] Always invoke other handler by its 'global' name. cf. [3]
    -- end of "globals.scpt"
    -- END OF SCRIPT 2A
      Mac OS 9.1.x  

  • Basic Action Script 3 question

    I've been watching a tutorial on making a thumbnail photo gallery with Flash. Unfortunately the only tutorial I could find that explained everything step by step was for Flash MX and I'm using Flash CS4. It seems that the scripting code is different. I've never written Flash script before. I am trying at this point to give a rollover effect to a thumbnail image, so when the mouse goes over the thumbnail the thumbnail will get brighter. The code given in the tutorial didn't work, but by looking at the debugger messages it seems like the script should be something like:
    thumb1.addEventListener(MouseEvent.MOUSE_OVER,mouseOverHandler);
    function mouseOverHandler(event:MouseEvent):void {
    thumb1.DisplayObject.alpha=100;
    I converted the thumbnail to a button symbol and then created an instance of the button called thumb1. The code is applied to a keyframe.
    Am I close with the code? How should it look?
    Thanks - Eric

    In Flash CS4 you can publish to either AS3 or AS2. The AS2 in CS4 is pretty much the same as it was in Flash MX (also known as Flash 6) — although there were some updates to AS2 since 2001!
    So if you want to use the tutorial as is, you would go to the Flash publish settings and change it to AS2.
    If you want to learn AS3 (and I would recommend that you do and forget AS2) you should be able to find tutorials for this. The code you gave isn't quite right. I don't know what that DisplayObject is doing in there. That is the name of a Flash Class, so you shouldn't give instance that as a name. I'm thinking your code should be something more like this:
    thumb1.addEventListener(MouseEvent.MOUSE_OVER,mouseOverHandler);
    thumb2.addEventListener(MouseEvent.MOUSE_OVER,mouseOverHandler);
    function mouseOverHandler(event:MouseEvent):void {
         event.currentTarget.alpha=100;
    There are also a lot of other ways to do this, but this is one of the simplest to understand.

  • Report Script "Parent" question.

    Essbase 7.1.5 on Solaris 5.9.
    We have a business owner who will be manually maintaining his "Entities" dimension, and would like to be notified when the source cubes (7 different cubes)that he is trying to stay in sync with are updated. Since the .olg output is not plain English enough for the business owner to track changes, we have written a Perl script to check for changes in a file, in our case Old Entities against New Entities (files generated from Report Script).
    Since it is common for level 0 members to change parents (stores moving to different districts) I would like to be able to show the Parent of each member in the report script. I am trying to use the <PARENT function but have been unable to get it to work the way I want it to.
    I need to not have to put the "mbrname" hardcoded as its parameter, but I need the resulting members of
    <LINK(<idescendants("EBIT"))
    to be used as the "mbrname" parameter.
    Any help or ideas would be greatly appreciated.
    BTW, I have considered Outline Extractor but we are running on a Unix environment, and the user is monitoring only a subset of each dimension so checking and reporting ALL dimension changes could show extraneous information.
    Message was edited by:
    RobertR

    If a reference outline is available, the otlcomp.exe program can run on a client and generate a spreadsheet that lists the differences for them in plain english. Yes, it lists all changes, but each dimension has it's own tab making the comparison a little less confusing.
    You can get it from www.dougware.com in the download section. It may or may not be what you are looking for.

Maybe you are looking for