Why does the delay in an applescript editor increase by itself?...***

so im trying to write myself a (very simple) auto typer for an mmorpg i play. i found a script for such an application on http://www.sythe.org/archives/438387-how-make-your-own-mac-auto-typer.html and proceeded to edit it for myself. the problem im having is that the delay is set to 3 for every line, but for **** sake, it just keeps slowing down after about a dozen lines. i have tried shortening the application to only 10 lines, and then clicking the continue button, but upon clicking the continue button it simply keeps upping the delay... WHY THE **** MUST YOUR EDITOR NOT WORK APPLE?!?!?!?!?!
and when i had the application set to do about 30 lines, again the frequency of the typing would significantly decrease after it typed my message about a dozen times. my script is as follows:
tell application "System Events"
          set texttosay to "Sample Text"
  display dialog "Text to say:" default answer ""
          set texttosay to the text returned of the result
          repeat
                    activate application "Old School RuneScape"
  keystroke texttosay
  keystroke return
  delay 3
  keystroke texttosay
  keystroke return
  delay 3
  keystroke texttosay
  keystroke return
  delay 3
  keystroke texttosay
  keystroke return
  delay 3
  keystroke texttosay
  keystroke return
  delay 3
  keystroke texttosay
  keystroke return
  delay 3
  keystroke texttosay
  keystroke return
  delay 3
  keystroke texttosay
  keystroke return
  delay 3
  keystroke texttosay
  keystroke return
  delay 3
  keystroke texttosay
  keystroke return
                    display dialog the "Do you want to quit?" buttons {"Continue", "Quit"} default button 1
                    if the button returned of the result is "Quit" then
                              exit repeat
                    end if
          end repeat
end tell

try it this way: save the following as an application (not as a script) and run it.
property texttosay : "Sample Text"
on run
  display dialog "Text to say:" default answer ""
          set texttosay to the text returned of the result
end run
on idle
          tell application "System Events"
                    if frontmost of process "Old School RuneScape" is false then
                              set frontmost of process "Old School RuneScape" to true
                    end if
  keystroke texttosay
  keystroke return
                    return 3
          end tell
end idle
this solves a couple of problems:
it keeps the script from constantly trying to activate the OSR app
there's no context shift from system events to OSR; the app is activated by system events itself
is removes the delay commands and replaces them with a 3 second idle loop. an idle loop puts the app to sleep while a delay command merely halts the execution of the script. the former is much more efficient fromt he processor's perspective.

Similar Messages

  • Why does the content displayed on my screen increase without my doing anything

    While I browse on the internet, I frequently must close my app because the screen gets distorted where I cannot make out what is on my screen. It is like what ever was on the screen gets four times bigger. I am unable to get the display to return to its original state which forces me to close down my app. Am I doing something wrong?

    In Safari, a double tap with one finger on the Magic Mouse or a two finger double tap on the Trackpad will zoom in.  You should be able to repeat that gesture to zoom out.  You can disable those functions in System Preferences > Mouse > Point & Click tab > uncheck smart zoom. For the trackpad it's in System Preferences > Trackpad > Scroll & zoom tab.
    Regards,
    Captfred

  • Why does the elements 13 change resolution when going into the editor -- it is huge and unusable

    why does the elements 13 change resolution when going into the editor? -- it is huge and unusable

    Many mysteries...
    Which is your OS version ?
    Your screen is 1920 by 1080 pixels.
    The problem appeared after having worked normally.
    When we select a picture from the organizer (album) and click on the edit button.  The editor software changes the entire computer resolution from 1920 x 1080 to   640 x 480 (very unusable).
    That's not clear for me: did you click on the 'Edit' button on the bottom right part of the organizer, or did you use the menu or the right click popup menu to open the editor? In the second case, you are in the editor workspace.
    We tried right clicking on the Elements 13 icon, select properties and under compatibility we made sure that "run in 640 x 480 screen resolution" was de-selected, and it was.    Cannot find any properties window for the editor?  
    The editor has its properties in the 'Edit/preferences' menu, but there is nothing about resolution there.
    Just to be sure : when you are in the organizer with the left 'Folders' panel shown, you highlight one of those pictures to edit. Then you right click and choose to "go to folder". Do the images are shown as 'offline' ? If that is the case, the original are on an external drive which is not connected, and what you are seeing is a 'preview' copy on your computer with 640 x 480 resolution.

  • Using Windows 7 and LR 5  when I look at the Keyword List a certain keyword has 7 pictures but when I check the Library Filter with that keyword 350 pictures are shown which includes the 7 pictures that have the keyword.  Why does the Library Filter showi

    Using Windows 7 and LR 5,  when I look at the Keyword List a certain keyword has 7 pictures but when I check the Library Filter with that keyword 350 pictures are shown which includes the 7 pictures that have the keyword.  Why does the Library Filter showing pictures that do not match the query

    Dan,
    Here's what's going on in the catalog you sent me, "Joel & Caitlin's Wedding".  There is the keyword "gwenn", which is explicitly assigned to 7 pics. But keyword "schwartz" has a number of synonyms, including "gwenn", and it is assigned to 25 pics.  There is no overlap between the two sets of pics. 
    I discovered these two occurrences by doing Metadata > Export Keywords, opening the exported file in an editor, and then searching for "gwenn".  I found two occurrences of "gwenn":
    gwenn
    schwartz
        {gwenn}
    From this, you can see that the keyword "schwartz" has 9 synonyms, of which "gwenn" is one.
    The filter criterion "Keywords Contain gwenn" will match the 7 pics that are explicitly assigned the keyword "gwenn", and it will also match the 25 pics assigned the keyword "schwartz", because that keyword has a synonym "gwenn".
    This illustrates the behavior I mentioned above: The criterion "Keywords contains x" will match against any of a pic's assigned keywords, any of those keywords' ancestor keywords, and any of the synonyms of the assigned keywords and their ancestors.
    So LR is operating correctly here, if not in a way that's easy to understand. 
    It appears that you are using the synonyms of "schwartz" to represent individual members of the Schwartz family.  A better way of representing family relationships is to have a parent keyword "Schwartz", with subkeywords for each family member, e.g. "Gwenn Schwartz", "Joe Schwartz", "Jane Schwartz", etc.  Repeating the family name in the subkeywords has a couple of advantages. LR usually only displays the "leaf" name of a keyword, so instead of showing you just "Joe", it will show you "Joe Schwartz", helpful when there are a number of different people whose first name is "Joe".  Also, if you ever export your pics to other software, it may not understand the LR hierarchy and won't show the parent keywords, so again it's more informative to see a keyword named "Joe Schwartz" rather than "Joe".

  • Why does the wheel for the apps close and how to keep it open?

    why does the wheel for the apps on the tool bar close and how to keep it open? i've checked thru all the information on your site..

    Exactly which driver did you downlaod and from where? By "GET STRAT", do you mean one of the Getting Started VIs? Error 5 means "NI-488:  Command requires GPIB Controller to be System Controller." Are you using GPIB to control the instrument? If so, what type of board are you using and which version of VISA and NI-488? If the error only occurs on a read, try issuing the query from MAX and see if the error occurs there. In a couple of the Xantrex drivers I looked at, there seemed to be some fixed delays after a write and before a read. You might try increasing those values to see if that makes any difference.

  • Why does the new operating system not delete the moved files from their original location - it seems like an enormous waste of space, time and effort to clean up every file once you've moved it

    Why does the new operating system not delete the moved files from their original locations - it seems like an enormous waste of space, time and effort to clean up every file once you've moved it - also, when transferring large amounts of files it becomes a very large problem remembering which files were transferred and which not.

    You're going to need to be more specific, as I'm not quite sure I understand what you're talking about.
    If you're referring to copying from an external hard drive or flash drive, and you want to actually move files rather than copy them, you can hold down the option key to force it to do a "move" rather than a "copy." This is not new behavior, though... the Mac OS has worked this way as long as I can recall (and I've been using it since 1984).
    If you're having a problem with trying to move files from one place to another on a single drive causing them to be copied instead, that is likely because of some permissions issue preventing you from actually being able to move them.

  • Why does the screen on my iPad mini jump around?  Apps open and close, I can't get back to the home screen.  Is my mini possessed?

    Why does the screen on my iPad mini start jumping--larger, smaller--can't close apps.  I reboot and still it happens.  Any suggestions?

    If the unit has NEVER been jailbroke, first try a system reset.  It cures many ills and it's quick, easy and harmless...  Hold down the on/off switch and the Home button simultaneously until you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  It could take well over an hour!  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow the on-screen directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."
    At the end of the basic Restore, you will be asked if you wish to sync the iPad/iPod.  As before, say "yes."  Note that that sync selection will disappear and the Restore will end if you do not respond within a reasonable time.  If that happens, only the apps that are part of the IOS will appear on your device.  Corrective action is simple -  choose manual "Sync" from the bottom right of iTunes.
    If you're unable to do the Restore, go into Recovery Mode per the instructions here.  You WILL lose all of your data (game scores, etc,) but, for the most part, you can redownload apps and music without being charged again.  Also, if you have IOS-7, read this.

  • Why does the iPhone convert animated .GIF images?

    I saved a bunch of animated .GIF files on my iPhone.
    When I imported them onto my computer, they were all single framed .JPG files.
    Why does the iPhone convert the images, and is there any way to prevent this?
    Thanks!

    you can play gif in webView ,just the same way you load a jpeg or png..
    NSString *path = [[NSBundle mainBundle] pathForResource:@"santa" ofType:@"gif"];
    NSURL *url = [NSURL fileURLWithPath:path isDirectory:NO];
    /* Load the request. */
    [myWebView loadRequest:[NSURLRequest requestWithURL:url]];
    the gif that is locally saved will be loaded.

  • Why does the error message "Microsoft Outlook must be closed because an error occurred" keep coming up?

    why does the error message "Microsoft Outlook must be closed because an error occurred" keep coming up?

    Reboot the machine.

  • "Why Does The Shuffle Songs Feature Perform So Poorly?"

    How'dee,
    I have an iPod 160G Classic, I've spent the last 3 months taking my 2,247 "Owned" cd's (I'm a retired dj), an ripped them with identical settings and transfered them flawlessly onto my iPod. I now have a total of 26,311 tracks on my iPod. "FWI"- I tranfered each "Complete" album, no individual tracks... I had been looking forward to being able to Shuffle through my music and not actually listening to individual ablums at a time. I work as a security guard and I am able/allowed to use my iPod via my Bose dock.
    I have been listening to my iPod in Shuffle Mode for 3 full weeks now and I am finding that I'm continually listening to the same 30 or so albums out of the full 2,247 that are on my iPod, sometimes it will actually play a song from a perticular album and then play Another track from that same album within the next 10 - 15 tracks!
    In the end I'm hearing One New Track that I haven't heard yet every 15 - 20 or so tracks while at the same time I'm hearing tracks from the same albums and or groups throughout the 15 - 20 tracks that have played... As an example, I have 4 albums from the group KISS, I hear tracks from those 4 albums atleast 3 - 5 times every day - day & half... Why does the Shuffle Mode work so poorly? I can't see for the life of me why the so-called "Shuffle Mode" doesn't Shuffle through "ALL" of the 2,247 tracks that are on the iPod.
    I've even gone as far as to use a cable to plug my iPod into a regular radio allowing me "Not" to charge my iPod until the battery is almost dead, allowing it to play continuously for my entire 8 hour shift in Shuffle Mode. And then just resume the next shift for another 8 hours, again, until the battery is almost dead. I've gotten around 35+ hours per charge over the last 2 weeks.
    "My whole reason for spending $350. on this iPod was so that I could listen to my album collection as though I were listening to a radio... shuffling through "All" of my tracks. I'm now sitting here kicking myself in the a$$ for seemingly wasting my money..."
    Any insight would be appreciated.
    And just to let it be known, I have attempted to play tracks manually just to see if they are even workable transfers and I haven't come across any problems with the music that I put on the iPod.
    The ToxicOne...

    It is true - "random" does not mean that you should not hear two songs from the same album (or artist) in close proximity. However, as the number of albums increases, the likelihood of hearing multiple (sometimes three or four) cuts from the same album decreases. And the chances of this happening EVERY time a new shuffle is started is even less likely. Comparing flipping a coin (a 0.5 probability of any given result) to a library with over 2000 albums (a .0005 probability of a track from any given album) is comparing apples to oranges. Also, given one of the posts above which indicated hearing the same *progression of songs* indicates that the mathematical algorithm used by Apple to simulate randomness (as there is no such thing as true randomness in computer programming) is just not up to snuff.

  • Why does the highlight feature seem not to work about 1/2 the time in various ibooks.  I'm trying to take notes and about 50 pages into a book the highlight feature stopped working.

    I've long noted that the highlight feature in ibooks is clunky and fairly limited in it's note-taking features, but the last two books I've read I've had trouble getting the highlight feature to work at all.  I click and drag over text and nothing happens.  I try with command depressed and nothing happens.  If I double click a bunch it will eventually highlight one word, but nothing more.  What gives?
    Also, not to be snarky, but why can't I seem to find a button that would read text to speach for me?  How do blind people use this service, or illiterate, or dyslexic, or people like myself who can learn far more from hearing then from reading. 
    And why does the text of a book often render so that it's haf cut off of the page?

    There is a button for speech within the iBooks menu. Edit > Speech. You might be better off buying Audiobooks. You can get them from the iTunes Store or Audible.com

  • Why does the iPad Mini not have music play count?

    I bought an iPad Mini and also have a macbook. I had listened to various music on my iPad Mini the other day, however when I connected the iPad Mini to the Macbook and iTunes via the lightning connector to sync, it synced the ratings I gave the songs I listened to on the mini, but no play count, as if I had not listened to anything. I hope there is something I can do about this as I often look at my play count!!

    Katrina UK
    It should work work but these kind of bugs pop up between updates, both hardware and software. Try closing all apps in the recently used list on the iPad. Double tap the Home button, tap and hold one of the icons at the bottom till they wiggle then tap the to close them. Tap the Home button to get back to the Home screen then hold the sleep button till you see the slide to power off message. Once it has powered down completely hold the Sleep button till the Apple icon appears.
    tomyiiii
    Re: Why does the iPad Mini not have music play count? 
    Nov 18, 2012 11:34 AM (in response to Katrina UK)
    Does it even really matter...?
    Many people including myself rely on playcounts to control smart playlist to manage large libraries. Smart playlists can be created to show your most or least played tracks and used more or less as your favorites or other uses. Along with playcounts the date is transferred so to keep a fresh list of music on my smaller iPods a smart playlist set to songs not played in the last month keeps some fresh tunes on it.
    Playcounts are also used to manage Podcasts in iTunes to delete older episode. Bookmarks, which can also be effected by this, can mess up audiobooks, movies and podcast playback between different devices. So yes, it does matter.

  • Why does the callender not have a four weekly?

    Why does the apple calendar not have a four weekly. This would be a great help.

    This is on the I pad. I don't have a mac, only a pc.

  • On my MacBook Pro with Retina Display, Why does the "USB Devices Disabled Unplug the device using too much power to re-enable USB devices" keep coming up after I unplugged the usb device?

    On my MacBook Pro with Retina Display 15", that I purchased a few weeks ago, started coming up with the following message on my desktop:
    "USB Devices Disabled Unplug the device using too much power to re-enable USB devices".
    I unplugged the device and the message still keeps coming up.
    This is what I have done so far to troubleshoot:
    I shut down the laptop. When booting up I pressed the command+option+p+r at the same time. It comes up with a menu to reinstall OSX, Get help online, Run Disk Utility, etc. I choose the disk utility and repair the disk and then restarted.
    The message keeps popping up and I can't seem to get rid of it. Why does the message keep popping up even though I don't have any devices hooked up to the laptop at all? Any help to reenable my usb ports and get rid of the messaage would be helpful.

    I talked to Apple Support and we at least stopped the bleeding, a little bit. These are the troubleshooting steps I did before I contacted Apple Support:
    1. Reinstalled OSX
    2. Restore the last known good Time Machine Backup.
    This did not fix my issue, so I called Apple Support and they told me this:
    1. Turn Power off.
    2. Wait 15 seconds.
    3. Plug in Magsafe adapter.
    4. Wait 15 seconds.
    5. Hold down the Shift+Option+Power Button for 20-30 seconds.
    6. Turn Power back on.
    Ok, this stopped the bleeding a little, but as soon as I plugged in a Apple USB Superdrive
    and a Apple Mini Displayport to VGA Adapter. This "USB Devices Disabled" pop-up pops up like every 30 minutes now. At least, it is not constantly popping up after I close it, so I guess it will do for the temporary. Going to contact Apple support, later, though to see what else can be done.

  • Why can't I access the balance in my iTunes account?  Why does the process always end up on the credit card page instead of accessing my balance?

    Why can't I access the balance in my iTunes account?  Why does the process always end up on the credit card page instead of accessing my balance?

    Alice Vanderlund wrote:
    Why can't I buy more international songs in the U.S. iTunes store??
    Because the owners of the songs have not licensed them for sale in the U.S.
    Apple doesn't have any say in the matter. it's up to the owner of the distribution rights for the music.

Maybe you are looking for

  • Opening balance for Trial balance report

    Hello  Experts, I have requirment to develop a Trial Balance report with the colum like Opening Balance, Transaction Debit,Transactoin Credit and closing balance. I am trying to get opening balance from the Table FAGLFLEXT. how can I get the opening

  • Workflow for object

    Hi All, I can see workflow for object when i click play like button just beside actions button on transaction in GUI. Where i can see the same thing on crm webui. Is  there any specific assignment block . I want to see workflow overview on that parti

  • Here is some interview qustions i have faced please help

    1) How can we take output returned by Stored Pocedure? 2) Diffarence b/w MVC1 and MVC2 ? 3) Why SinglethreadModel is deprecated? 4) while useing polymorphisam what's wrong with instanceof() method? 5) Servelt chaning follows which designpattern? 6) w

  • AlivePDF setup

    Does anyone here have experience with AlivePDF?  Has anyone gotten it to work?  It seems like the default answer for getting PDF generation in Flex is to use AlivePDF but their web site mostly has examples using AIR. I am using AlivePDF 0.1.4.9. in F

  • Adobe Download Assisstant Problem

    I try to download a trial version of CS6.  When the terms and conditions page for the adob download assistant comes up, it's unresponsive.  I read that it has to do with your firewall settings.  Even when I turn my firewall completely off, it still d