• 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: Problem under OSX 10.2.6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem under OSX 10.2.6


  • Subject: Re: Problem under OSX 10.2.6
  • From: Neil Faiman <email@hidden>
  • Date: Thu, 31 Jul 2003 08:06:28 -0400

"filepath" is a string, but "file type" and "creator type" are properties of Finder file objects, not of strings. Instead of

set filePath to i as string
if file type of filePath is "TEXT" then
set creator type of filePath to "MSWD"
end if

you would want

set filePath to i as string
if file type of file filePath is "TEXT" then
set creator type of file filePath to "MSWD"
end if

However, fileList is already a list of files, so the real answer is that you didn't want to cast the files to strings in the first place. I think that this would do what you want:

on open fileList
tell application "Finder"

repeat with theFile in fileList
if file type of theFile is "TEXT" then
set creator type of theFile to "MSWD"
end if
end repeat
end tell
end open

-Neil Faiman

On Thursday, July 31, 2003, at 07:54 AM, J|rgen Keser wrote:

Hi,

I've become an error that is called

Can't get <<class asty>> of "OSX:Users:...."


Here is also the script that causes the error. Is there anyone that knows
an solution for this problem?


on open fileList
tell application "Finder"

repeat with i in fileList
set filePath to i as string
if file type of filePath is "TEXT" then
set creator type of filePath to "MSWD"
end if
end repeat
end tell
end open



Greetings,

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

  • Prev by Date: Re: Problem under OSX 10.2.6
  • Next by Date: is this possible?
  • Previous by thread: Re: Problem under OSX 10.2.6
  • Next by thread: is this possible?
  • Index(es):
    • Date
    • Thread