Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: open for access file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: open for access file



 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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.