• 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: can't make document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can't make document


  • Subject: Re: can't make document
  • From: Deivy Petrescu <email@hidden>
  • Date: Mon, 23 Feb 2004 22:20:17 -0500

At 8:21 PM -0500 2/23/04, Wesley Smith wrote:
Here's the code form the script that I'm using to read the text file:
-----------------------------
tell application "Finder"
set Media_Hole to disk "Media Black Hole"
set Pavilion to folder "pavilion" of Media_Hole
exists file "listing.txt" of folder "Pavilion" of disk "Media Black Hole"
set listing to file "listing.txt" of folder "Pavilion" of disk "Media Black Hole"
get properties of listing
open for access file "listing.txt" of folder "Pavilion" of disk "Media Black Hole"
get eof of result
end tell
------------------------------
If I replace the third to last line with:

There are a lot of errors. First you define variables that are not used (Media_Hole, Pavilion), and put lines of code for which you do not care about the result (exists file...).
If you just want to get the eof of the file, do it fast and dirty:

try
get eof of alias "Media Black Hole:Pavilion: listing.txt" -- note alias not file!
on error
display dialog "File Media Black Hole:Pavilion: listing.txt does not exist"
end try

Also, if you open for access a file it will be created if it does not exist>

--
Regards
Saudagues

Deivy
http://www.dicas.com
_______________________________________________
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.

References: 
 >can't make document (From: "Wesley Smith" <email@hidden>)

  • Prev by Date: Re: Can't set creator type
  • Next by Date: redirect in mail.app
  • Previous by thread: Re: can't make document
  • Next by thread: print
  • Index(es):
    • Date
    • Thread