Re: Problem Reading Clipboard with Evernote URLs
Re: Problem Reading Clipboard with Evernote URLs
- Subject: Re: Problem Reading Clipboard with Evernote URLs
- From: Shane Stanley <email@hidden>
- Date: Fri, 24 Jun 2016 11:54:10 +1000
On 24 Jun 2016, at 11:40 AM, Jim Underwood <email@hidden> wrote:
>
> So, when I don't know what's on the Clipboard, should I always use your ASObjC method, rather than the simple:
> set clipText to the Clipboard as text
In a sense, only you can answer that. I don't know that many apps put multiple strings on the clipboard, but then I've never really gone looking. The only other case where I've seen multiple clipboard items is with files, and in that case the Finder also puts the file names, separated by linefeeds, as a string on the first item.
That's the thing with the clipboard: as the client, you decide what you can handle or want, and try to read accordingly. There's no one fixed way -- it depends on what your script expects/wants.
> I could turn your code into a handler that returns a string with return delimiters.
> Is return or linefeed best for this purpose?
Again, whatever suits you, although I think linefeed makes more sense as a default these days, in case you're writing to file as UTF-8.
But you're making assumptions about what's on the clipboard; what if the strings already contain returns or linefeeds? So maybe it would be better to just return a list, and have the code that calls it deal with the issue. That would make the handler more flexible.
--
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