How to avoid system events "ignoring" lines in applescript?

Hello!
I am trying to write a very simple script that will trigger macros on another application, however when the script is executed, it skips a couple of lines which makes the whole process go erratically.
This is the code i'm using:
tell application "Adam"
  activate front window
end tell
tell application "System Events"
  keystroke "4"
          repeat 10 times
          end repeat
  keystroke return
  keystroke (ASCII character 47)
          keystroke "tell test"
  delay 1
  keystroke return
  keystroke (ASCII character 36)
  keystroke "t"
  keystroke (ASCII character 36)
  delay 2
  keystroke return
end tell
The red lines are the ones that seem to be neglected somehow (keystroke "4" doesnt carry the expected action in application "Adam"). I'm a newbie at applescripting but i fail to see why this might be happening
Any help is of course greatly appreciated

Hi Arthur!
Tried your solution without much success, after some playing around i found out changing the command to use any other keystroke (e.g. - ) actually made the script work as intended, although it also implied changing the macro trigger (4 to - ) in application Adam.
repeat 10 times
keystroke "-"
end repeat
Lately I've been testing with other applications and found out this "ignore" behaviour happens mostly when you use numbers for keystrokes, perhaps there is al alternate way of inputting these?
Thanks for your and everyone's help

Similar Messages

  • How to avoid the event has been repeated many times in the background

    Application, the main screen is divided into two containers:left and  right container,
    The right side of the container is divided into two containers:top and  bottom container,
    There is a button in the left container.
    Click the button, the container at lower right will using ModuleManager  load Module,  The following container load of the right of the screen  has been monitoring the container above the action.
    Problem:
    When you click the button repeatedly to load the container in the lower  right, it will create multiple instances, and can not be freed  immediately. When the above container do an action or event, there are  multiple instances of monitoring exist.
    The background will be repeat the action or event many times.
    How to avoid the event has been repeated many times in the background?
    Thanks

    Flex harUI
    multiple instances of a mxml, maybe ?

  • How to avoid doubleclick event on a datagrid scrollbars?

    Hello.
    I've a datagrid.
    I need a doubleclick event cliccking on a data grid row.
    I've enabled the doubleclick event. It works fine, when the user doubleclicks on a row, an event happens! In my case I open a modal window. Great!
    Now the problem:
    The problem arises when the user clicks in a short time on a data grid scroll bar (both horizontal or vertical). In this case a double click event is dispatched.
    But his intenton is just to scroll the grid, no more.
    Please, notice that the dobule click on a scrollbar is a well-known action that can be performed in all the applications and operating systems.
    I neet the "double click" event just on a data grid rows and not on its scrollbars. Cliccking twice or more on the scrollbar I just want to scroll the grid. How can avoid to dispatch an event?
    Thank you
    Pbesi

    I was returning today to add something about custom item renderers but you beat me to it, Pbesi.   I have a custom gridItemRenderer which I now have to check for just as you demonstrated above.  What I don't understand is why I can't just do this:
    if( event.target is IGridItemRenderer )  //Should be true for both default and custom
    My custom renderer implements the IGridItemRenderer interface, but when I double click one in the grid, the event.target is not myCustomGridItemRenderer, it is GridLayer.  So what I have to do is this:
    if( (event.target is IGridItemRenderer) || (event.target is GridLayer) )
    I presume this would work for all custom gridItemRenderers, but I only have one, so I haven't tested this.  Any idea why GridLayer is the type of the event target?  My custom renderer is very simple.  It just renders Booleans as "Yes/No" rather than "True/False"
    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx"
          clipAndEnableScrolling="true"
          implements="spark.components.gridClasses.IGridItemRenderer">
          <fx:Script>
               <![CDATA[
                    override public function prepare(hasBeenRecycled:Boolean):void {
                         lblData.text = (data[column.dataField] == true) ? "Yes" : "No" ;
                                  ]]>
         </fx:Script>
          <s:Label id="lblData" top="9" left="7"/>
    </s:GridItemRenderer>

  • How to avoid system slow when login first time  everyday

    if login system first time every day, it will be very slow for loading web application.
    I think maybe it 's  reload cache every night or by a certain perods of time.
    how to avoid this situation. or set cache reload a time per week?
    Thanks.

    Terry,
    I would confirm your application pools are set up as suggested in the install documentation.  This should resolve your issue.
    Thanks,
    Drew

  • How to avoid system queries in AWR?

    Hi,
    In my AWR ,always i get system queries as follows.Is it related to AWR snap IDs I am collecting?How do i avoid these queries in my AWR?Kindly assist.
    insert into wrh$_parameter (snap_id, dbid, instance_number, parameter_hash, value, isdefault, ismodified) select :snap_id, :dbid, :instance_number, i.ksppihash hash, substr(sv.ksppstvl, 1, 512), sv.ksppstdf, decode(bitand(sv.ksppstvf, 7), 1, 'MODIFIED', 'FALSE') from x$ksppi i, x$ksppsv sv where i.indx = sv.indx and (((i.ksppinm not like '#_%' escape '#') or (sv.ksppstdf = 'FALSE') or (bitand(sv.ksppstvf, 5) > 0)) or (i.ksppinm like '#_#_%' escape '#')) order by hash
    insert into wrh$_sga_target_advice (snap_id, dbid, instance_number, SGA_SIZE, SGA_SIZE_FACTOR, ESTD_DB_TIME, ESTD_PHYSICAL_READS) select :snap_id, :dbid, :instance_number, SGA_SIZE, SGA_SIZE_FACTOR, ESTD_DB_TIME, ESTD_PHYSICAL_READS from v$sga_target_advice

    Sure you can avoid them. Disable AWR.
    Sorry, but they are the queries required to get AWR data, and the fact you see them means not much happens in your database.
    The result of instrumenting Oracle with AWR is the database never will do nothing anymore.
    If you can't live with that, stop using Oracle or AWR.
    Sybrand Bakker
    Senior Oracle DBA

  • Catching System.exit() or How to avoid System.exit() - Third Party Tool ???

    Hi All,
    I am using a third party tool which is internally calling System.exit sometimes and my application
    got terminated most of the times.
    It is happening always when i call a particular method of that third party tool.
    Is there any way to catch or avoid the System.exit while using the particular method?
    I need this urgently...Please kindly help.....
    Thanks,
    J.Kathir

    There's a fair bit to it, and you should refer to the appropriate java Tutorials. Bascially you create a .policy file and install a sercurity manager with:
    System.setSecurityManger(new SecurityManager());The policy file grants a set of permissions to various "code sources", basically each codesource is a classpath entry. You could grant "AllPermissions" to your own code, and a more restricted set of permissions to the application you're running. But you can't subtract permissions, i.e. you can't say "this code can do anything except call System.exit().
    I doubt this is going to provide you with a good solution. It's tiresome to set up, and when the client app called System.exit it would crash, which might not result in a clean status.
    I'd consider if you should be using this client app in the same JVM, rather than creating a subordinate JVM using Runtime.exec.

  • How to avoid system standby programmatically?

    Hi all,
    I implemented an application that uses NSThread to transfer pictures from a digital camera. The process might take long so I would like to ensure that the Mac won't go to sleep during the transfer.
    I have three questions:
    1). Is it actually possible for the Mac to go to sleep during such process?
    2). Assuming that the answer of 1). is 'yes', how can achieve that programmatically?
    3). If 2). is done and picture transfer is finished how can I (programmatically) reset to the
    previous state?
    Basically I need two methods: 'avoidSystemStandBy' and 'resetSystemPreviousStandByMode'.
    Regards
    - artOf...

    See 'Managing Power' in +I/O Kit Fundamentals+.

  • Open file With System Events

    i have a backup and sychronizing program called Synk that is currently unscriptable. I want to set up folder action so that when i plug various drives in this program opens the correct backup files and the program.
    So far i have managed to get the program to open and i have managed to get the open dialog box up, i have also managed to get it to click the right button to start the process. Where this fails is when selecting the correct backup file. The open dialog box appears and i can see which one i want it to select, but i am unsure of how i get system events to select a specified item from the open dialog box. It also fails to initalize when the drive is inserted.
    on adding folder items to this_folder after receiving added_items
    if (added_items as string) contains "Humphrey" then
    --set bup to file "Humphrey To University.sknd" of folder "Backup documents" of folder "documents" of "home"
    tell application "Synk"
    activate
    tell application "System Events"
    key code 31 using {command down}
    -- open bup
    -- (click the radio button "Open" of window) open
    tell process "Synk"
    click the button "Run" of the front window
    end tell
    end tell
    end tell
    end if
    end adding folder items to
    Rich

    Richard,
    Does this help:
    tell app "Finder" to open file "Humphrey To University.sknd" of folder "Backup documents" of folder "documents" of "home"
    It should open Synk for you with the target settings file.
    Reese

  • DAQmx in Event structure / avoid multiple events

    Hi all
    I've started creating program for acquisition and analysis of data . I don't have much experience in LabVIEW, but it's important to me to start creating this application in good way. Can you give me some advice about things below?
    I prepared template with Event structure, based on some article .
    First question is how exactly place DAQmx blocks in it. Now they are all on one state of case structure "test", but I'm not sure that's correct because most of the example on NI side have initialization (like sample rate, number of saple) outside of the loop? It's important to make it possible to change parameter between measurements.
    Second. How to avoid multiple events. In example: button TEST is pressed, measurement is taken. This measurement take a long time. I've started bored, and some other buttons (maybe TEST ) accidentally were pressed. When measurement is completed  it would be good idea to destroy this events associated with accidently pressed buttons. It is possible to do it? What's the best way when there's a lot of buttons(when analysis part of program will be added)?
    Best Regards
    PS. sorry about my english
    Attachments:
    pgm.vi ‏33 KB
    Enum_Events.ctl ‏5 KB

    Dear Finch!
    Welcome to NI Forums!
    My first advice regarding your code would be to use shift registers instead of Queues as your state storage, since (as you've said) there is no reason to store multiple events that have happened. The state machine design pattern, which I strongly recommend in this scenario is built into LabVIEW, you can use it as a template if you go to the New.. menu.
    Please check out these materials for further discussion about state machines.
    You are correct in that most of the DAQmx VIs can be placed outside of the loop, only DAQmx Read (the function we actually use more then once) must be placed inside the loop, the rest can stay out. If you want to modify some parameters (like Timing) mid-execution, you only have to stop the task, set them, then start it again.
    This can be easily done in a different state, which can execute only when some parameters have changed.
    Also, if you want your user to be unable to interact with certain controls while the test is being taken, you can programmatically disable them with a Property Node. 
    Please get back to me if you have any other questions.
    Best regards:
    Andrew Valko
    NI Hungary
    Andrew Valko
    National Instruments Hungary

  • AWT System Event Queue

    Hello all,
    I'm interested in how the AWT system event queue works. I'm talking about the EventQueue we can all retrieve using Toolkit.getDefaultToolkit().getSystemEventQueue().
    My main questions are:
    1) What happens to events once they get on the queue?
    2) How do the AWT Components get notified of the events?
    3) How is the correct AWT Component to notify determined?
    I've done a little bit of Googling but haven't found anything explaining how the event queue actually works.
    In case you're wondering, I'd like to know all this because I'm in a position where I need to mimick the system event queue's behaviour without actually touching it.
    Any links to further reading, suggestions or comments are most welcome.
    Thanks in advance,
    Sam

    Hello Sam,
    Your questions could be answered by the following documents:
    http://java.sun.com/j2se/1.3/docs/guide/awt/designspec/events.html
    http://download.java.net/jdk6/docs/api/java/awt/doc-files/AWTThreadIssues.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/FocusSpec.html
    Cheers,
    Sam

  • How to avoid output file and error lines when condition does not match

    Hi Experts
    A customer want to send purchase order files to several vendors and each vendor has their own requirement to content and file format. I have prepared scenarios for each vendor and a template is (conditionally) called when CardCode matches. It works fine, - PO file is generated when CardCode matches, but error lines are written to SAP B1 Control Center each time CardCode does not match the one defined in a scenario (100 or more times per day). Problem is that these error lines does not get automatic deleted. Conditional processing are made in this way:
    Result Message in SAP B1 Control Center when CardCode does not match:
    I tried to avoid an error line in SAP B1 Control Center when CardCode does not match in this way:
    Then no error lines are written to SAP B1 Control Center, but an output file is generated each time (order file when CardCode matches and an empty file when CardCode does not match).
    Any suggestions on how to avoid both errors types (error lines in SAP B1 Control Center and empty output files)?
    Or - can lines in SAP B1 Control Center be automatic deleted?
    Regards
    Steen

    Hi Steen,
    using <b1im_skip> should be the right approach, if you're working with B1 OUTBOUND.
    Following extract form the B1i help describes the usage to skip the outbound processing:
    1.1 Skipping Outbound Processing
    If you do not want to hand over the message to the receiver system, the scenario step can create a special tag that indicates to generic processing in the integration framework to skip the message processing.
    Add the following to the final transformation atom (atom0):
    <b1im_skip xmlns= ”” info=”my info” msglog=”true” msgout="yes">
    If the integration framework skips the message, it puts the message log information to the Filtered section, if the message log is switched on. The result message contains the Message skipped by vBIU logic information.
    info
    To display an individual message, define it using the info attribute.
    msglog
    If you want to avoid an entry in the message log, introduce the msglog attribute and set it to false.
    msgout
    To display the skip information in the Success section of the message log, use the msgout attribute and set it to yes.
    In case you don't want any MsgLogEntry in case of a skipped message, please enter the following in final atom0:
    <xsl:template name="transform">
    <xsl:attribute name="pltype">xml</xsl:attribute>
    <xsl:choose>
    <xsl:when test="$msg/BOM/BO/Documents/row/CardCode=&apos;C20000&apos;">
    <xsl:call-template name="transform2"/>
    </xsl:when>
    <xsl:otherwise>
    <b1im_skip info="skipped" msglog="false"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    Best regards
    Bastian

  • How to avoid Line Items(fields) in BAPI mapping.

    Hi
    Does any body help me for mapping between header and line items in BAPI..
    my scenario is filerfcmail(wokflow)!
    File is CSV based :
    (ex: 001150,,1123,JERM,08122006,,,
         ,,,ANN,,01082006,
    If you look at example csv file , there is some fields mixed with header and line items. But in RFC header can be 1 to 1 and line item should be 0 to Unbound.
    Now my problem is if I sent above example csv file as source :
    The payload coming like this(sxmb_moni) :
    </HEADERDATA>
    - <GLACCOUNTDATA>
    - <item>
      <COSTCENTER />
      <PROFIT_CTR />
      </item>
    - <item>
      <GL_ACCOUNT>738100</GL_ACCOUNT>
      <ITEM_AMOUNT>60000</ITEM_AMOUNT>
      <COMP_CODE>001150</COMP_CODE>
      <ITEM_TEXT>*777-8030-861</ITEM_TEXT>
      <COSTCENTER>7320</COSTCENTER>
      <PROFIT_CTR>7320</PROFIT_CTR>
      <ALLOC_NMBR />
      </item>
    - <item>
      <GL_ACCOUNT>738100</GL_ACCOUNT>
      <ITEM_AMOUNT>40000</ITEM_AMOUNT>
      <COMP_CODE>001151</COMP_CODE>
      <ITEM_TEXT>*777-8030-861</ITEM_TEXT>
      <COSTCENTER>6010</COSTCENTER>
      <PROFIT_CTR>6010</PROFIT_CTR>
      <ALLOC_NMBR />
      </item>
      <item />
      </GLACCOUNTDATA>
    You can find there is one more item coming after headerdata with null values. It means map reading first line and one by one , if any field found in rows which belogs to GLAccount(Line item), then it writing one more item after headerdata with that fields only.
    Remainig GLAccount data coming as per map after the item .
    Can you tell me how to avoid extra line items.
    Thanks,
    Sankar

    Yes, It exist..
    I cross checked ..with out givig fileds and giving some fields...its writing another items in after headerdata tag.
    hope you understand , what my problem..
    See: GLACCOUNTDATA under subnode
          item is 0 to unbound in BAPI side, because of this its reading all rows , and if find any field which belongs to GLAccount , then it writing another item tag after headerr data.
    Thnaks,
    Sankar

  • How to avoid white lines

    Hi All,
    How to avoid the white lines below the selection-options text in the selection screen of the report?
    I am seeing light while lines below each selection-options or parameters text
    Thanks
    aRs

    hi,
    don't use simple select-options / parameters
    but
    <b>selection-screen begin of line</b>
    ...select-options
    ...    end of line
    sample from RFKORD10
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(30) TEXT-101.
    SELECTION-SCREEN POSITION POS_LOW.
    PARAMETERS      VSTID    LIKE RF140-VSTID.
    SELECTION-SCREEN POSITION POS_HIGH.
    PARAMETERS      DVSTID   LIKE RFPDO1-KORD10DV DEFAULT ' '.
    SELECTION-SCREEN COMMENT 61(9) TEXT-102.
    SELECTION-SCREEN END OF LINE.
    A.
    Message was edited by:
            Andreas Mann

  • How do you get a new line in a description of an iCal event?

    I need to be able to create multiple lines in a description of an iCal event.  In the past, I used control return to get a new line.  In Mountain Lion, this does not show up as a new line, once the event has been saved.  It merges all of the text onto one line and creates new lines as the space dictates.  How can I force new lines in the event description between the words that I have chosen?

    I'm interested too.
    Please help, I had own method to management  iCal's event – new line, of 10.7 worked great – now is a little terrible for me :/

  • How to avoid line break ( br ) while exporting Interactive report in Excel

    Hi,
    I have a Interative report and I am using Apex download format as CSV.
    I have defined some of the column heading in multiple line using break < br >
    when I export this into the excel sheet..the column heading contains break also..
    - Any idea how to avoid line break while exporting in excel.
    - also how to put the columns heading in BOLD when exported in excel.
    Thanks,
    Deepak

    Hi Jari,
    I tried this but still getting the
    <br>Interactive Report
    Column Attributes Heading - Employee<br>Detail AddressWhen I download the Report in CSV Format
    I am getting the heading with <br>.
    I am looking for heading as - Employee Detail Address // with no <br> tagThanks,
    Deepak

Maybe you are looking for