• 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: Folder or a package ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder or a package ?


  • Subject: Re: Folder or a package ?
  • From: "Thomas C." <email@hidden>
  • Date: Mon, 12 May 2003 20:17:26 +0200

Thanks Christopher, I think System Events will do the trick.

Thomas

Christopher Nebel wrote :

On Sunday, May 11, 2003, at 11:27 AM, Thomas C. wrote:

Is there a way I can make the difference between a folder and a package without using the 'info for' command which is too slow ?

Use the disk-folder-file suite in System Events:

tell application "System Events"
set f to folder "Applications" of disk "Jaguar"
set anApp to item "Address Book.app" of f
set aFolder to item "AppleScript" of f

class of anApp --> folder
class of aFolder --> folder
package folder of anApp --> true
package folder of aFolder --> false
end tell

(You might get a different answer for "class of" in a future release -- it's not entirely logical that packages claim to be folders, though that's what they really are on disk.)


--Chris Nebel
Apple Development Tools
_______________________________________________
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: 
 >Re: Folder or a package ? (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Updating windows in Mail
  • Next by Date: iCal event scripting
  • Previous by thread: Re: Folder or a package ?
  • Next by thread: Creating PDF files from a browser
  • Index(es):
    • Date
    • Thread