• 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 with simple finder script- make new file, open for access
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with simple finder script- make new file, open for access


  • Subject: Re: Problem with simple finder script- make new file, open for access
  • From: dev_sleidy <email@hidden>
  • Date: Tue, 1 Aug 2006 10:19:36 -0400

The first code segment (of the original post) when modified as ...

set AGATE to "22.03.2006 - Philadelphia Flyers 6 vs. New York Ranges 3"
set winningTeam to "Philadelphia Flyers"

tell application "Finder"
 set MyFile to make new file at desktop with properties {name:winningTeam}
 open for access file MyFile with write permission
 write AGATE to file MyFile starting at eof
 close access file MyFile
end tell

... fails with 'Script Editor' (AppleScript) of MacOS X 10.0.0, 10.2.0, 10.2.8, 10.3.4, and 10.4.4.

All of the above mentioned MacOS X versions - displayed errors stated:

'AppleScript Error ... Finder got an error; "cant's make the file (document file "Philadelphia Flyers" of folder "Desktop" of folder "s" of folder "Users" of startup disk) into type file specification.

When re-written as ...

set AGATE to "22.03.2006 - Philadelphia Flyers 6 vs. New York Ranges 3"
set winningTeam to "Philadelphia Flyers"

tell application "Finder"
set MyFile to (make new file at desktop with properties {name:winningTeam}) as string
set fRef to open for access file MyFile with write permission
write AGATE to fRef starting at eof
close access fRef
end tell


... the above mentioned MacOS X versions of 'Script Editor' (AppleScript) - produced the desired results.

-----

Simplified versions of the working code are provided below -

set AGATE to "22.03.2006 - Philadelphia Flyers 6 vs. New York Ranges 3"
set winningTeam to "Philadelphia Flyers"

tell application "Finder" to set MyFile to (make new file at desktop with properties {name:winningTeam}) as alias

set fRef to open for access MyFile with write permission
write AGATE to fRef starting at eof
close access fRef

... or ...

set AGATE to "22.03.2006 - Philadelphia Flyers 6 vs. New York Ranges 3"
set winningTeam to "Philadelphia Flyers"

set fRef to open for access (((path to desktop from user domain) as string) & winningTeam) with write permission
write AGATE to fRef starting at eof
close access fRef
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Problem with simple finder script- make new file, open for access
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Converting images from one format to another
  • Next by Date: Re: Launch Services info (was "Re: Auto-Remove .DS_Store Files?")
  • Previous by thread: Re: Converting images from one format to another
  • Next by thread: Re: Problem with simple finder script- make new file, open for access
  • Index(es):
    • Date
    • Thread