Packages

Kay C Lan lan.kc.macmail at gmail.com
Mon Dec 10 03:25:05 EST 2007


On Dec 9, 2007 9:59 PM, Chipp Walters <chipp at chipp.com> wrote:

Here's one example: I've got a product that resizes graphics, but I
> don't want them to 'go into' a package and find and resize the
> graphics there. How to know if you're in a 'package' or 'bundle'?
>
>
Sorry, been out of the loop for a couple of days, but here's my suggested
starting point;

put this in a do statement:

tell application "AppleScript"
  files of folder "Disc:folderA:folder1"
end tell

reports only Apple recognised files in the provided location

tell application "AppleScript"
  folders of folder "Disc:folderB:folder2"
end tell

reports only Apple recognised folders in the provided locations

tell application "AppleScript"
  packages of folder "Disc:folderC:folder3"
end tell

reports only Apple recognised packages in that location.

For added convenience, but slightly confusing depending on which side of the
fence you're on, the packages are reported as either 'application files'
which are of course folders that are applications, and 'document files'
which are of course folders that look like files (.band,.rtfd,.key)

One simple test I did, was that packages are the only folders that seem to
have a '.suffix', I've never thought anyone else would actually name a
folder with a .suffix, so I did, and the above correctly identified "test
folder.test" as a simple folder.

Sorry I haven't got around to producing the desired function, I'm a little
busy with my day job right know, but given time  I think I'd be able to come
up with something.

As someone else has said, for me I've only ever needed to delve into
packages that I've created so I know where I am and where I want things to
go. I've never really had a need to delve inside someone else's package, but
for those that do, I hope the above gets you on your way.



More information about the use-livecode mailing list