Tab char doesn't work

Jim Ault jimaultwins at yahoo.com
Sat Aug 7 17:38:16 CDT 2010


'tab' is a keyword, but not a command , 'return' is a command in a  
function and will be a different color

'space' and 'tab' should be the same color, just as 'comma'.

Try the simple 'replace tab with space in var
------
get the clipboardData["text"]
replace tab with space in IT
set the clipboardData["text"] to IT
------
        since replaceText is expecting a regEx string.
I think you need to escape the tab char for the string to work


On Aug 7, 2010, at 3:14 PM, Bill Vlahos wrote:

> I want to intercept a paste command to replace any tabs or returns  
> in it with spaces so they don't get pasted into a table object. The  
> script below works for returns but not tabs. Notice that color of  
> the word tab is not even the same as the color of the word return.  
> It is like the tab character isn't being recognized.
>
> on pasteKey -- replace returns and tabs with spaces before pasting  
> for attachments description (actually any table)
>   if word 2 of the target begins with "revCell-" then
>      set the clipboardData["text"] to replaceText(the  
> clipboardData["text"],return,space)
>      set the clipboardData["text"] to replaceText(the  
> clipboardData["text"],tab,space)
>   end if
>   paste
> end pasteKey
>
> I put this script into a frontscript.
>

Jim Ault
Las Vegas






More information about the use-livecode mailing list