Skip to content

Instantly share code, notes, and snippets.

@pjrobertson
Created September 27, 2012 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjrobertson/3794702 to your computer and use it in GitHub Desktop.
Save pjrobertson/3794702 to your computer and use it in GitHub Desktop.
+// Contents of sourceFiles are SBObjects (i.e. it's technically an SBElementArray)
+ NSMutableArray *sourceFiles = [[NSMutableArray alloc] initWithCapacity:[files count]];
+ for (NSString *path in files) {
+ [sourceFiles addObject:[[finder items] objectAtLocation:path]];
+ }
+ FinderItem *destinationItem = [[finder items] objectAtLocation:destination];
+
+ if (copy) {
+ [(SBObject *)sourceFiles duplicateTo:destinationItem replacing:NO routingSuppressed:NO exactCopy:YES];
+ } else {
+ [(SBObject *)sourceFiles moveTo:destinationItem positionedAt:nil routingSuppressed:NO];
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment