Re: Special Paste
Hi Charles, Your examples are about pasting; > Both Apple's Pages and Microsoft’s Word software have key commands for > pasting text into an existing document to match the current formatting (font). But, your question is about copying; > How do you script to accomplish this when copying text to the clipboard in a > button so the user does not have to use keyboard commands? However, you can manipulate the clipBoardData both when when copying and pasting if you wish. When copying the text, if you want the clipboard to contain unformatted (Plain) text, then use this in a “Copy Unformatted" button: on mouseUp set the clipBoardData["text"] to the selection end mouseUp Or when pasting unformatted text, use this in a “Paste Unformatted” (= “Paste and Match Style or Paste and Match Formatting”) button: on mouseUp put the clipBoardData["text"] into the selection end mouseUp Or if your app has a menu, then your Edit Menu script may look something like this: on menuPick pWhich switch pWhich case "Cut" Cut break case "Copy" Copy break case "Copy Plain Text" set the clipBoardData["text"] to the selection break case "Paste" Paste break case "Paste and Match Style" put the clipBoardData["text"] into the selection break case "Clear" Clear break case "Preferences" go cd "Preferences" break end switch end menuPick By pasting Unformatted Text, the pasted text will take on the style of the text at the selection point. clipBoardData in the Dictionary explains more. Have fun. Paul > On May 28, 2020, at 07:04, Charles Szasz via use-livecode > wrote: > > Both Apple's Pages and Microsoft’s Word software have key commands for > pasting text into an existing document to match the current formatting > (font). How do you script to accomplish this when copying text to the > clipboard in a button so the user does not have to use keyboard commands? > > Sent from my iPad > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
Hi Charles, Is this what you’re looking for?: put the clipboardData["html"] into tStoredData put the fullClipboardData["text"] into tData set the clipboardData to tData paste set the clipboardData["html"] to tStoredData Peter Bogdanoff > On May 28, 2020, at 7:04 AM, Charles Szasz via use-livecode > wrote: > > Both Apple's Pages and Microsoft’s Word software have key commands for > pasting text into an existing document to match the current formatting > (font). How do you script to accomplish this when copying text to the > clipboard in a button so the user does not have to use keyboard commands? > > Sent from my iPad > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Special Paste
Both Apple's Pages and Microsoft’s Word software have key commands for pasting text into an existing document to match the current formatting (font). How do you script to accomplish this when copying text to the clipboard in a button so the user does not have to use keyboard commands? Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
Oh right got it backwards. Bob S > On Oct 24, 2016, at 18:41 , hh wrote: > > @Bob. > After your answer I read Charles' question again. Probably he asks > for the other way: how to match the styled text of the 'paste-target' > *in LC*? > > @Charles. If this is correct, then you could try to insert the > clipboardData["text"] or use menu Edit > Paste Unformatted. > This has no style and thus inherits the style of the current > paste-location (that may be also inherited). > > If you use or need *Unicode* for pasting you could use a plain-text-key > of the rawClipboardData. This requires LC 8 or later and is dependent > of the current OS (see dictionary entry to rawClipboardData). > > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
@Stephen. This is really a great stack. TMHO, it should become a 'standard' plugin for LC 8/9 (the 'old' clipboardData-version for LC 6/7). In the meantime, please upload it to "Sample Stacks" (livecodeshare)? > Stephen B. wrote: > I've updated my clipboard data exploring stack to include RAW clipboard > data. There's suddenly a lot of data in the clip. A good test is a Pages, > Web or Word document text copied. > version 8 (legacy!) version > go URL "http://fulton.barncard.com/stax/clipboardTest(8).livecode" > version 9 > go URL "http://fulton.barncard.com/stax/clipboardTest(9.0).livecode" ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
I've updated my clipboard data exploring stack to include RAW clipboard data. There's suddenly a lot of data in the clip. A good test is a Pages, Web or Word document text copied.. version 8 (legacy!) version go URL "http://fulton.barncard.com/stax/clipboardTest(8).livecode" version 9 go URL "http://fulton.barncard.com/stax/clipboardTest(9.0).livecode" I hope this helps you in your quest. sqb Stephen Barncard - Sebastopol Ca. USA - mixstream.org On Mon, Oct 24, 2016 at 4:01 PM, Bob Sneidar wrote: > I believe there is the clipboardData ["html"] and clipboardData ["rtf"]. > > Bob S > > > > On Oct 24, 2016, at 12:29 , Charles Szasz wrote: > > > > I having been trying to implement Paste and Match Style found on Pages > app and also on Word, which is called Paste Special, where the text > contents of the clipboard are pasted into a document that matches the > existing font and font style in the document. > > > > I searched the Rev and LC archives and could not find any examples. > Does anyone have a script for this? > > > > > > > > Charles Szasz > > csz...@mac.com > > > > > > > > > > ___ > > use-livecode mailing list > > use-livecode@lists.runrev.com > > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-livecode > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
@Bob. After your answer I read Charles' question again. Probably he asks for the other way: how to match the styled text of the 'paste-target' *in LC*? @Charles. If this is correct, then you could try to insert the clipboardData["text"] or use menu Edit > Paste Unformatted. This has no style and thus inherits the style of the current paste-location (that may be also inherited). If you use or need *Unicode* for pasting you could use a plain-text-key of the rawClipboardData. This requires LC 8 or later and is dependent of the current OS (see dictionary entry to rawClipboardData). ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
I believe there is the clipboardData ["html"] and clipboardData ["rtf"]. Bob S > On Oct 24, 2016, at 12:29 , Charles Szasz wrote: > > I having been trying to implement Paste and Match Style found on Pages app > and also on Word, which is called Paste Special, where the text contents of > the clipboard are pasted into a document that matches the existing font and > font style in the document. > > I searched the Rev and LC archives and could not find any examples. Does > anyone have a script for this? > > > > Charles Szasz > csz...@mac.com > > > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Special Paste
I having been trying to implement Paste and Match Style found on Pages app and also on Word, which is called Paste Special, where the text contents of the clipboard are pasted into a document that matches the existing font and font style in the document. I searched the Rev and LC archives and could not find any examples. Does anyone have a script for this? Charles Szasz csz...@mac.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
As far as I can tell there is no way to access the clipboard on mobile? Using clipboardData on iOS throws an error on mobile and the dictionary says both clipboardData and fullClipboardData are not available on mobile? On 18 November 2015 at 13:26, Geoff Canyon wrote: > I'm using 6.7.3, so the fundamental component works: > > put clipboardData["text"] into the selectedchunk > > On Wed, Nov 18, 2015 at 7:43 AM, Peter M. Brigham > wrote: > > > I don't know, does it? I'm a relative troglodyte, as I work in 5.5 > mostly, > > but I don't see why it wouldn't work in later versions. With the newer > > additions to the language there are probably other ways to accomplish the > > task. > > > > -- Peter > > > > Peter M. Brigham > > pmb...@gmail.com > > http://home.comcast.net/~pmbrig > > > > On Nov 17, 2015, at 9:13 PM, Charles Szasz wrote: > > > > > Peter, > > > > > > Does this script work with LC 6.1.3? > > > > > > Sent from my iPad > > > > > > ___ > > > use-livecode mailing list > > > use-livecode@lists.runrev.com > > > Please visit this url to subscribe, unsubscribe and manage your > > subscription preferences: > > > http://lists.runrev.com/mailman/listinfo/use-livecode > > > > > > ___ > > use-livecode mailing list > > use-livecode@lists.runrev.com > > Please visit this url to subscribe, unsubscribe and manage your > > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-livecode > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
I'm using 6.7.3, so the fundamental component works: put clipboardData["text"] into the selectedchunk On Wed, Nov 18, 2015 at 7:43 AM, Peter M. Brigham wrote: > I don't know, does it? I'm a relative troglodyte, as I work in 5.5 mostly, > but I don't see why it wouldn't work in later versions. With the newer > additions to the language there are probably other ways to accomplish the > task. > > -- Peter > > Peter M. Brigham > pmb...@gmail.com > http://home.comcast.net/~pmbrig > > On Nov 17, 2015, at 9:13 PM, Charles Szasz wrote: > > > Peter, > > > > Does this script work with LC 6.1.3? > > > > Sent from my iPad > > > > ___ > > use-livecode mailing list > > use-livecode@lists.runrev.com > > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-livecode > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
I don't know, does it? I'm a relative troglodyte, as I work in 5.5 mostly, but I don't see why it wouldn't work in later versions. With the newer additions to the language there are probably other ways to accomplish the task. -- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig On Nov 17, 2015, at 9:13 PM, Charles Szasz wrote: > Peter, > > Does this script work with LC 6.1.3? > > Sent from my iPad > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
But I am using LC 6.1.3. Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
Peter, Does this script work with LC 6.1.3? Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
To expand on this, below are the handlers I have in my LC frontscript, so I can paste and match style anywhere in LC. -- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig -- on commandKeyDown pKey -- to paste plain text --(matching the formatting of the target field) -- Mac: command-control-V -- Win: control-alt-V --(change these if you wish, in the pastePlain handler) -- put this handler and the pastePlain hanlder into a frontscript --where it will operate everywhere in LC -- requires pastePlain switch pKey case "V" pastePlain if the result is "justPaste" then pass commandKeyDown end if break default -- add your other commandkey scripts before the default pass commandKeyDown end switch end commandKeyDown on pastePlain -- to paste plain text --(matching the formatting of the target field) -- Mac: command-control-V -- Win: control-alt-V --(change these if you wish) -- put this handler and the commandKeyDown hanlder into a frontscript --where it will operate everywhere in LC -- requires commandKeyDown if the tool is not "browse tool" \ or the clipboard is not "text" \ or the selectedField is empty then return "justPaste" end if switch the platform case "MacOS" if the controlkey is up then return "justPaste" break case "Win32" if the altkey is up then return "justPaste" break default return "justPaste" end switch -- now plain text is needed put the clipboarddata["text"] into the selectedchunk end pastePlain -- On Nov 17, 2015, at 12:50 AM, Geoff Canyon wrote: > I think this works: > > put clipboardData["text"] into the selectedchunk > > There may be failure modes I'm unaware of. > > On Mon, Nov 16, 2015 at 11:25 PM, Charles Szasz wrote: > >> I having been trying to implement Paste and Match Style found on Pages app >> and also on Word, which is called Paste Special, where the text contents of >> the clipboard are pasted into a document that matches the existing font and >> font style in the document. >> >> I searched the Rev and LC archives and could not find any examples. Does >> anyone have a script for this? >> >> Sent from my iPad >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode >> > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
Please look also in the dictionary of newest LC 8: fullClipboardData and rawClipboardData greatly enhanced the clipboard access. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Special Paste
I think this works: put clipboardData["text"] into the selectedchunk There may be failure modes I'm unaware of. On Mon, Nov 16, 2015 at 11:25 PM, Charles Szasz wrote: > I having been trying to implement Paste and Match Style found on Pages app > and also on Word, which is called Paste Special, where the text contents of > the clipboard are pasted into a document that matches the existing font and > font style in the document. > > I searched the Rev and LC archives and could not find any examples. Does > anyone have a script for this? > > Sent from my iPad > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Special Paste
I having been trying to implement Paste and Match Style found on Pages app and also on Word, which is called Paste Special, where the text contents of the clipboard are pasted into a document that matches the existing font and font style in the document. I searched the Rev and LC archives and could not find any examples. Does anyone have a script for this? Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode