Re: open for access file
Re: open for access file
- Subject: Re: open for access file
- From: James Bensley <email@hidden>
- Date: Thu, 16 Jul 2009 13:44:33 +0100
the Author's code was as follows . . .
set MyFile to "Macintosh HD:Users:Jerry:Documents:GroceryList.txt"
I made the same setting but replaced 'Jerry' with my home folder and
used a differently named text file.
Mike
----------------------------------------------------------------
I get confused with those kinds of file locations "Macintosh
HD:Users:Jerry:Documents:GroceryList.txt", try this example:
set filePath to (POSIX file ("/Users/Mike/Documents/MyTextFile.txt")
set fileLines to paragraphs of (read filePath before return)
repeat with nextLine in fileLines
display dialog nextLine
end repeat
That will loop though a text file displaying a dialog with one line of
text in each dialog box.
See http://www.satimage.fr/software/en/smile/external_codes/file_paths.html
for info on converting the different types of file paths
See http://docs.info.apple.com/jarticle.html?path=AppleScript/2.1/en/as201.html
for info on the read command
See http://forums.macrumors.com/archive/index.php/t-124419.html for
some info about the loop I used
I hope I haven't confused you more or made it worse ;)
James ;)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GIT/MU/U dpu s: a--> C++>$ U+> L++> B-> P+> E?> W+++>$ N K W++ O M++>$ V-
PS+++ PE++ Y+ PGP t 5 X+ R- tv+ b+> DI D+++ G+ e(+++++) h--(++) r++ z++
------END GEEK CODE BLOCK------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden