• 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: move with System Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: move with System Events


  • Subject: Re: move with System Events
  • From: Shane Stanley <email@hidden>
  • Date: Sun, 24 Nov 2013 16:40:46 +1100

On 24 Nov 2013, at 3:13 AM, koenig.yvan <email@hidden> wrote:

In Mavericks, the function move a disk item is no longer flagged as UNAVAILABLE YET :

FWIW, by using an ASObjC-based library you can be free of the quirks and foibles of System Events and the Finder for much of your file management. For example:

use framework "Foundation"

on moveFileAt:POSIXPath toFolder:folderPOSIXPath
set POSIXPath to current application's NSString's stringWithString:POSIXPath
set theName to POSIXPath's lastPathComponent()
set folderPOSIXPath to current application's NSString's stringWithString:folderPOSIXPath
set theNewPath to folderPOSIXPath's stringByAppendingPathComponent:newName
set fileManager to current application's NSFileManager's defaultManager()
set theResult to fileManager's moveItemAtPath:POSIXPath toPath:theNewPath |error|:(missing value)
return (theResult as integer = 1)
end moveFileAt:toFolder:


-- 
Shane Stanley <email@hidden>
<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

  • Follow-Ups:
    • Re: move with System Events
      • From: "koenig.yvan" <email@hidden>
References: 
 >move with System Events (From: "koenig.yvan" <email@hidden>)

  • Prev by Date: Re: move with System Events
  • Next by Date: Re: move with System Events
  • Previous by thread: Re: move with System Events
  • Next by thread: Re: move with System Events
  • Index(es):
    • Date
    • Thread