Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Precise timing




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: http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Re: Placing long URLs in email (From: "Jan M." <email@hidden>)
 >Precise timing (From: Gil Dawson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.