lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS X question about Apple's Preview


From: Jacob Rus
Subject: Re: OS X question about Apple's Preview
Date: Fri, 08 Dec 2006 03:19:49 -0500
User-agent: Thunderbird 3.0a1 (Macintosh/20060706)

Arjan Bos wrote:
tell application "Preview"
    repeat with i from 1 to number of windows
        set current_window to item i of windows
        set current_name to name of the document of the current_window
        if current_name is "AdemVanEeuwigheid.pdf" then
            close window i
                        exit repeat
        end if
    end repeat
end tell

This is very un-idiomatic applescript. The following is functionally identical, but cuts out much of the complexity.

    tell app "Preview"
        repeat with doc in (documents whose name is "foo.pdf")
            close doc
            exit repeat
        end repeat
    end tell





reply via email to

[Prev in Thread] Current Thread [Next in Thread]