NSFileManager's odd behavior
NSFileManager's odd behavior
- Subject: NSFileManager's odd behavior
- From: Takaaki Naganoya <email@hidden>
- Date: Wed, 22 Jul 2015 20:09:06 +0900
This script generates 1000 folders on Desktop/test by using Cocoa NSFileManager.
But this stops after few folder generated. Why?
<AppleScript>
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
set homeDir to current application's NSHomeDirectory()
set fileManager to current application's NSFileManager's defaultManager()
set aResList to {}
repeat with i from 1 to 1000
set aDirText to "Desktop/test/" & (i as string)
set aDirStr to (current application's NSString's stringWithString:aDirText)
set dirPath to (homeDir's stringByAppendingPathComponent:aDirStr)
set aRes to (fileManager's createDirectoryAtPath:dirPath withIntermediateDirectories:true attributes:false |error|:(reference))
--> error number -10000 -[__NSCFBoolean objectForKey:]: unrecognized selector sent to instance 0x7fff740798b8
set the end of aResList to aRes
end repeat
</AppleScript>
--
Takaaki Naganoya
email@hidden
http://piyocast.com/as/
_______________________________________________
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