Packages

Sarah Reichelt sarah.reichelt at gmail.com
Sat Dec 8 17:42:45 EST 2007


> If only it were that easy.  In addition to ".pkg" packages and ".app"
> packages, there are also an unknown number of "files" which are
> packages, including Garage Band's ".band" packages and others.
>
> Given the wide variety of ways the OS may use to determine whether a
> folder is a folder or a package I think it's safe to say the best
> solution would not rely on our scripted workarounds, but instead use the
> OS API.

While this has never bothered me, since the only bundles/packages I
deal with are my own apps so I know what goes where, Rev seems a bit
confused about such things.

If you do "answer file" you can select a bundle e.g. .band,
.iMovieProject, .app, .bundle
After that, Rev sees it as a folder and "is there a file" will fail,
while "is there a folder" will return true.
If you do "answer folder", you will not be able to select one of these bundles.

Setting the defaultFolder to a folder containing some of these bundles
(I used my Movies folder as a test), these bundles are not listed in
"the files", only in "the folders".

This does however provide a way of determining a bundle:
    answer file "Select a file:"
    put it into tName
    if there is a folder tName then
        answer tName & " is a bundle."
    else if tName is not empty then
        answer tName & " is a file."
    end if

Cheers,
Sarah



More information about the use-livecode mailing list