• 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: Getting full file paths on clipboard with AS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting full file paths on clipboard with AS


  • Subject: Re: Getting full file paths on clipboard with AS
  • From: Shane Stanley <email@hidden>
  • Date: Tue, 27 Sep 2011 14:38:55 +1000

On 27/09/2011, at 1:24 PM, David Crowe wrote:
what I really want is to get all the file paths. Is that possible?

Not using "the clipboard". If you get the clipboard as text, you get all the names, and if you can assume all the items are in the same folder, you can build the paths that way. But that's a pretty big assumption.

It looks like the clipboard commands need updating to recognize multiple pasteboard items, which were introduced in 10.6. Someone should file a request.

If you can stretch to AppleScriptObjC, this will give you what you want:

-- get the pasteboard
set pb to current application's NSPasteboard's generalPasteboard()
-- get its file-only URLs
set theURLs to pb's readObjectsForClasses_options_({current application's NSURL}, {NSPasteboardURLReadingFileURLsOnlyKey:true})
-- convert them all to POSIX paths
set thePosixPaths to theURLs's valueForKey_("path")


-- 
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: 
 >Getting full file paths on clipboard with AS (From: David Crowe <email@hidden>)

  • Prev by Date: Getting full file paths on clipboard with AS
  • Next by Date: Re: Getting full file paths on clipboard with AS
  • Previous by thread: Getting full file paths on clipboard with AS
  • Next by thread: Re: Getting full file paths on clipboard with AS
  • Index(es):
    • Date
    • Thread