• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Precise timing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Precise timing


  • Subject: Re: Precise timing
  • From: kai <email@hidden>
  • Date: Sun, 30 Oct 2005 11:03:43 +0000


On 29 Oct 2005, at 07:52, Gil Dawson wrote:

Hi--

I'm trying to get my lyrics to scroll with my CD, but the timing isn't precise enough. I was wondering whether anyone might kow of a better way to time my pulses.

on idle
tell application "Microsoft Word"
               tell window 1
                        small scroll down 1
                end tell
        end tell
        return 0.7
end idle

I match the lyrics to my scrolling speed by inserting blank lines into my lyrics. M ostly, it works fine.

The problem is that the time between scrolling pulses is not as uniform as I would like. If it were sometimes early and sometimes late, that would be OK so long as it evened out after a few lines. But it isn't. Sometimes it's 'way late and never catches up.

Is there another way to fire off a command, a way that is more tied to a timer?


I suppose you could try comparing the number of scrolls with the actual time elapsed, Gil. Untested - but perhaps something like this:

--------------------

property startDate : missing value
property totalScroll : 0
property scrollPause : 0.7

on idle
    tell ((current date) - startDate) div scrollPause
        set currScroll to it - totalScroll
        set totalScroll to it
    end tell
    tell application "Microsoft Word" to tell ¬
        window 1 to small scroll down currScroll
    scrollPause
end idle

set startDate to current date
set totalScroll to 0

--------------------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Precise timing
      • From: kai <email@hidden>
References: 
 >Re: Placing long URLs in email (From: "Jan M." <email@hidden>)
 >Precise timing (From: Gil Dawson <email@hidden>)

  • Prev by Date: Re: [mac-wizards] iCal Summary More
  • Next by Date: Re: Precise timing
  • Previous by thread: Precise timing
  • Next by thread: Re: Precise timing
  • Index(es):
    • Date
    • Thread