file type question
file type question
- Subject: file type question
- From: Jim Brandt <email@hidden>
- Date: Thu, 9 Oct 2003 06:55:26 -0500
Running the following script on a file gives:
on Info_File( Source )
tell application "Finder"
set filename to name of file Source as text
set filefolder to folder of file Source as text
set filekind to kind of file Source as text
set filecreator to creator type of file Source as text
set filetype to file type of file Source as text
set msg to "File: " & Source & return & return
set msg to msg & " Name: " & filename & return
set msg to msg & " Folder: " & filefolder & return
set msg to msg & " Kind: " & filekind & return
set msg to msg & " Creator: " & filecreator & return
set msg to msg & " Type: " & filetype
display dialog msg
end tell
end Info_File
tell application "Finder"
set source to "HD1:Text File"
my Info_File( source )
end tell
File: HD1:Text File
Name: Text File
Folder: HD1:
Kind: Tex-Edit Document
Creator: TBB6
Type: TEXT
However, I have several scripts that, under OS 9 used the following syntax:
set theList to (every item of folder source1 whose file type is "TEXT")
when run under OS X I get the following error:
get every item of folder "HD1:Misc:" whose file type = "TEXT"
--> Finder got an error: Can't get every item of folder "HD1:Misc:"
whose file type = "TEXT".
How do I get this to work the way it did under OS 9?
BTW, using:
set theList to (every item of folder source1 whose kind is "Tex-Edit
Document")
works, but not when I want to deal with all text documents in a
folder, regardless of the program that created them.
_______________________________________________
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.