implementing AS in Cocoa: how to specify a document to close

  • This is probably a dumb question but in the following AS Dictionary statement:

    close specifier : the document(s) or window(s) to close

    what can I use for "specifier"?

    "close document 1" works fine, but I want to be able to specify a particular document whose position is unknown. I know the document's path on disk.

    "close every document whose path is "/whatever" "?

    Thanks,

    Don

    ------------
    Don Hall
    Apps & More Software Design, Inc.
    <don...>
  • On 14 May 2012, at 21:51, Donald Hall wrote:

    > This is probably a dumb question but in the following AS Dictionary statement:
    What application are you targeting?

    >
    > close specifier : the document(s) or window(s) to close
    >
    > what can I use for "specifier"?
    The usual element specifiers are name, index, id, some, every, range, relative and test.
    Not every element will support every specifier. The AS dictionary may help.

    >
    > "close document 1" works fine, but I want to be able to specify a particular document whose position is unknown. I know the document's path on disk.
    >
    You can identify the document to close using any of the supported specifiers.

    > "close every document whose path is "/whatever" "?
    You will likely have to identify the index, name or id of a document in order to close it using a specifier.
    Perhaps your document object has a path property that will come to the rescue.
    You can iterate over the documents plural element until you find a match and then close the matching element.

    Regards

    Jonathan Mitchell
    Mugginsoft LLP

    ===============================================KosmicTask - the Integrated Scripting Environment for OS X.
    http://www.mugginsoft.com/KosmicTask
    ===============================================
previous month may 2012 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today