simple “repeat with” problem
simple “repeat with” problem
- Subject: simple “repeat with” problem
- From: Mitchell L Model <email@hidden>
- Date: Fri, 09 Dec 2016 16:31:38 -0500
Despite my long years of AppleScripting I despair of ever understanding the subtleties of "repeat with" loops. Here's an example that just makes no sense to me, even though I know from experience that the second formulation is often necessary. Why doesn't the first work?
This does not work:
tell application "Finder" set theFolder to folder ("/Library/Fonts/" as POSIX file) repeat with theFile in the files of the theFolder -- doesn't find any files: theFonts ends up empty copy the name of theFile to the end of theFonts
whereas this does:
tell application "Finder" set theFolder to folder ("/Library/Fonts/" as POSIX file) set theFiles to the files of the theFolder -- seems silly repeat with theFile in theFiles -- seems silly copy the name of theFile to the end of theFonts
|
_______________________________________________
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