• 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
Weird stuff happening.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird stuff happening.


  • Subject: Weird stuff happening.
  • From: André Benassi <email@hidden>
  • Date: Tue, 25 Sep 2001 21:31:54 -0500

Hi, I'm new to the list and AppleScript programming, and I've been
lurking for a couple of weeks.

I am starting on Mac OS X. I realize that AppleScript is pretty
incomplete as of OS X 10.0.4, but this seems out of the ordinary: (try
this)

tell application "Finder"
if ((count of items) > 0) then
try
-- set theProperties to name of item 1
set theProperties to index of item 1
set theProperties to container of item 1
set theProperties to disk of item 1
set theProperties to position of item 1
set theProperties to bounds of item 1
-- set theProperties to label index of item 1
set theProperties to locked of item 1
set theProperties to kind of item 1
set theProperties to description of item 1
set theProperties to comment of item 1
set theProperties to size of item 1
set theProperties to physical size of item 1
set theProperties to creation date of item 1
set theProperties to modification date of item 1
set theProperties to icon of item 1
set theProperties to url of item 1
set theProperties to icon size of item 1
set theProperties to owner of item 1
set theProperties to owner privileges of item 1
set theProperties to group privileges of item 1
set theProperties to everyones privileges of item 1
-- set theProperties to inspector window of item 1
on error errmesg number errnumber
error errmesg number errnumber
end try
end if
end tell

This script simply gets each property of (what happens to be) a folder
on my machine. It compiles on my machine, but you will notice that I
had to comment out two of the properties to get it to compile, most
notably the "name" property, which seems preposterous!

When I uncomment the "name" property I get the following error:
Finder got an error: Can't make some data into the expected type.
Anyone care to comment? This seems very wrong to me.

The "label index" error I understand, items in OS X do not have labels,
although I expect the fact that this property still exists either means
there are cross-compatibility issues, that labels may be reinstated at a
later date, or that someone just forgot.

The final property "inspector window", I think that I simply have a
knowledge shortcoming when it comes to windows. Do you have to open a
window before you can address it? Because I tried the code:

tell application "Finder"
open inspector window of item 1
set theProperties to name of inspector window of item 1
end tell

This code errs on "open..." with the message "Finder got an error: Can't
get inspector window of item 1." Is the inspector window property yet
valid under OS X, or am I making a semantic error?

adb


  • Prev by Date: Printing postscript from QuarkXpress
  • Next by Date: Re: AppleScript Studio
  • Previous by thread: Printing postscript from QuarkXpress
  • Next by thread: Showing OS9 Packages using AppleScript
  • Index(es):
    • Date
    • Thread