• 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
Re: Slow app with Fusion drive.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow app with Fusion drive.


  • Subject: Re: Slow app with Fusion drive.
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 13 Mar 2013 23:48:18 +1100

On 13/03/2013, at 10:06 PM, Brian Christmas <email@hidden> wrote:

Is there a command in Applescript ObjC to send a URL referenced folder to the trash?

In 10.8 it's simple:

tell fileManager to trashItemAtURL_resultingItemURL_error_(theURL, missing value, missing value)

And deleting rather than moving to the trash is easy with all versions:

tell fileManager to removeItemAtURL_error_(theURL, missing value)

But moving to the trash pre-10.8 is a bit ickier:

tell fileManager to performFileOperation_source_destination_files_tag_(current application's NSWorkspaceRecycleOperation, theURL's URLByDeletingLastPathComponent()'s |path|(), "", {theURL's lastPathComponent()}, missing value)

It's icky because it happens asynchronously, so if your code relies on the item having been trashed straight away, you could strike problems. This is especially the case with large folders. 

But it looks like you just want to get rid of empty folders, so deleting might be the most useful.

-- 
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

References: 
 >Slow app with Fusion drive. (From: Brian Christmas <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Shane Stanley <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Brian Christmas <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Shane Stanley <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Brian Christmas <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Shane Stanley <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Brian Christmas <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Shane Stanley <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Brian Christmas <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Shane Stanley <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Shane Stanley <email@hidden>)
 >Re: Slow app with Fusion drive. (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: how to assign a version to an apple script
  • Next by Date: Re: Slow app with Fusion drive.
  • Previous by thread: Re: Slow app with Fusion drive.
  • Next by thread: Re: Slow app with Fusion drive.
  • Index(es):
    • Date
    • Thread