• 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
'Info for' Questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'Info for' Questions


  • Subject: 'Info for' Questions
  • From: email@hidden
  • Date: Wed, 3 Mar 2004 09:28:54 -0500

When Duane Mitchell posted 'File path info' I tossed together an Example for each File Type - Alias, Application, Document; and a Folder displaying each Name/Value Pair returned by 'info for'.
However, I came upon two Problems myself - one with 'folder of info for' [for an Alias, Application, Document, and Folder] and another with respect to the returned 'icon position' and 'folder window' Coordinates [for a Folder].

I now find my self asking the two Questions presented below.

Any and all Information is appreciated.


Part 01 - trying to use 'folder of info for':

If I use ...

tell application "Finder"
set theFile1 to choose file with prompt "Choose a File:"
set fileInfo to info for theFile1
end tell

... among all the Name / Value Pairs in the Result Panel is a 'folder' of Value 'false'.

If 'choose file' is changed to 'choose folder' [and a Folder selected, via the 'Open' Button] - the Result displayed is the 'folder' Value of 'true'.

If I use ...

tell application "Finder"
set theFile1 to choose file with prompt "Choose a File:"
set fileInfo to info for theFile1

set folderStatus to (folder of fileInfo)

end tell

fileInfo & return & folderStatus

... I receive an 'AppleScript Error' Message of ...
"Can't get folder of {name:"Boogle", creation date:date "Freitag, 13. Februar 2004 19.29.06 Uhr", ... short version:"", long version:""}.

Excluding 'icon position' and 'folder window' noted below, I have no Problem with the other Record Name / Values returned by 'info for'. Yes, depending on whether one is obtaining Information for an Alias, Application, or Document File; or, Folder - some of the Values are not valid, etc. ...
'locked' and 'busy status' do not display for Alias and Applications Files, and Folders.
'short version' and 'long version' do not display for Alias and Document Files, and Folders.

The Value for 'folder' not being returned, is my only Problem, with respect to using 'info for' regardless of File Type [Alias, Application, Document], or if a Folder.

Question 01:
Whether using a String as the Path to a File, or the Return of 'choose file' or 'choose folder' - how does one obtain the boolean Value of 'folder' from 'info for' - instead of the 'AppleScript Error'?, as I am attempting with 'set folderStatus to (folder of fileInfo)' above.
P.S. Yes, I know about using 'if file (...) exist then ... end' or 'if folder (...) exits then ... end' in AppleScript. I am interested in using what 'info for' is supposed to be able to provide.

Part 02 - trying to understand what the 'icon position' and 'folder window' Coordinates really relate to:

tell application "Finder"
set theFolder to choose folder with prompt "Choose a Folder:"
set folderInfo to info for theFolder

set {iconPositionLeft, iconPositionBottom} to (icon position of folderInfo)
set {theLeft, theTop, theRight, theBottom} to (folder window of folderInfo)

end tell

"IconPosition:Left" & tab & tab & iconPositionLeft & return & "iconPositionBottom" & tab & iconPositionBottom & return & "Folder Window:Left: " & tab & theLeft & return & "Folder Window:Top: " & tab & theTop & return & "Folder Window:Right: " & tab & theRight & return & "Folder Window:Bottom: " & tab & theBottom

Question 02:
With respect to the 'info for' for a selected Folder [via the 'choose folder' 'Open' Button] - the returned 'icon position' Values and the 'folder window' Values returned are either all '0' or if a Value other than '0' is provided, the horizontal and vertical Point Values of the respective Icon, or the left, top, right, and bottom Points of the Folder's Window do not match with the actual Position of the Icon or Folder Window. Is there a way to obtain the actual location Points of the Icon and the four Corner Points of the Window, of the selected Folder? Naturally, a Document's 'info for' will only return 'icon position' Values and not 'folder window' Coordinates.


The above Observations are reproducible on the two Macs I am currently using.

Systems:
Dual 500 MHz G4 PPC PM, MacOS X 10.3.2, 1 GB RAM, > 200 GB Storage. [AppleScript Version: 1.9.3]
PowerMac 5200/75 LC, System 8.6, 64 MB RAM, 500 MB Storage. [AppleScript Version: 1.3.7]

To see the complete AppleScript Code generated using 'info for' for Alias, Application, and Document Files; and Folders - mentioned above, please go to '<http://applescript.250free.com>'.


Again, thank you for any Information and / or Clarifications,

--

SJWL
_______________________________________________
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.


  • Follow-Ups:
    • Re: 'Info for' Questions
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Disable keyboard?
  • Next by Date: Re: Flatten Artwork in Illustrator
  • Previous by thread: Disable keyboard?
  • Next by thread: Re: 'Info for' Questions
  • Index(es):
    • Date
    • Thread