• 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
NSFileManager's odd behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSFileManager's odd behavior
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: How can I get the count of these menu items?
  • Next by Date: Re: NSFileManager's odd behavior
  • Previous by thread: Re: How can I get the count of these menu items?
  • Next by thread: Re: NSFileManager's odd behavior
  • Index(es):
    • Date
    • Thread