Re: Getting full file paths on clipboard with AS
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")
|
_______________________________________________
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