• 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
Using CoreFoundation via ASOC - possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using CoreFoundation via ASOC - possible?


  • Subject: Using CoreFoundation via ASOC - possible?
  • From: has <email@hidden>
  • Date: Sat, 30 Jan 2016 00:11:33 +0000

Shane, Chris, etc

Any idea how to convert between AS and CF or ASOCified NS and CF types? I need to call a couple CFURL functions to convert between POSIX- and Windows-style file paths but ASOC doesn't seem to like CF very much:


    use framework "CoreFoundation"

    set filePath to "/Users/jsmith"
current application's CFURLCreateWithFileSystemPath(missing value, filePath, current application's kCFURLPOSIXPathStyle, false)

-- error "CFURLCreateWithFileSystemPath unable to set argument 1 - the AppleScript value <NSAppleEventDescriptor: 'utxt'(\"/Users/jsmith\")> could not be coerced to type {__CFString=}." number -10000



    use framework "CoreFoundation"

    set filePath to "/Users/jsmith"
set filePath to (current application's NSString's stringWithString:filePath) current application's CFURLCreateWithFileSystemPath(missing value, filePath, current application's kCFURLPOSIXPathStyle, false)

-- error "CFURLCreateWithFileSystemPath unable to set argument 1 - the AppleScript value <NSAppleEventDescriptor: 'obj '{ 'form':'ID ', 'want':'ocid', 'seld':'optr'($307664E0D97F0000$), 'from':null() }> could not be coerced to type {__CFString=}." number -10000


Thanks,

has
_______________________________________________
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: Using CoreFoundation via ASOC - possible?
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Status of AppleScript in Java?
  • Next by Date: Re: Using CoreFoundation via ASOC - possible?
  • Previous by thread: Re: Status of AppleScript in Java?
  • Next by thread: Re: Using CoreFoundation via ASOC - possible?
  • Index(es):
    • Date
    • Thread