• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Some package questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some package questions


  • Subject: Re: Some package questions
  • From: John Delacour <email@hidden>
  • Date: Tue, 26 Nov 2002 21:32:22 +0000
  • Mac-eudora-version: 5.3a9

At 8:32 pm +0100 26/11/02, Thomas wrote:

- why does the information command on a package say "foler:true" while when you use a package it's more as a file than as a folder. That would be more logic in my script if package would say "I'm not a folder".

There are different sorts of packages. All of them are essentially folders -- some look like folders and some look like yellow packages and some have proprietary icons.

Select a few in turn in the Finder and see what this gives:

tell application "Finder"
(item 1 of (get selection)) as string
{class, kind, file type, creator type, folder, properties} of item result
end tell

--{"Installer package", "pmkr", "pkg1", folder "Apache2" of folder "Downloads1102" of folder "jd" of folder "Users" of startup disk of application "Finder"}

--{"Application", "APPL", "CSOm", folder "Applications" of startup disk of application "Finder"}

--{"Mac OS X Preference Pane", "BNDL", "????", folder "PreferencePanes" of folder "Library" of startup disk of application "Finder"}



- is it possible to call for package info (true or false) within a Finder block, just to get this information (and don't use the info command which is slower because it asks for a lot of information).

I doubt if it makes much difference, but info for will give you a different set of properties from Finder properties. Look up 'item' in the Finder dictionary.

- Is it possible to ask for the file type within a Finder block AND if the item asked is a folder, it returns "" ? I don't manage to have this to work, the demand for file type on a folder returns an error contrary to the info command which returns "".

'file type' will never be folder. Use 'kind' instead

tell application "Finder"
(item 1 of (get selection)) as string
if kind of item result is "Folder" then beep
end tell

This will not beep for a package.

JD
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Some package questions (From: Thomas <email@hidden>)

  • Prev by Date: Re: Get path to a chosen folder
  • Next by Date: Re: Importing flat files into FMP
  • Previous by thread: Some package questions
  • Next by thread: PPD in OSX
  • Index(es):
    • Date
    • Thread