Quantcast
Channel: Adobe Community: Message List - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 3715

Manipulating the clipboard

$
0
0

I wanted to set up a command and shortcut to surround clipboard contents by [[ and ]] before pasting.

The purpose is to insert temporary citations which are put into the clipboard by an external application (EndNote).

 

The method mentioned in discussion Can I pull clipboard contents into a script variable is more than clunky: use a file as an intermediate.

 

On the other hand in AutoHotKey it is very easy to manipulate the clipboard. I have even used it to make code-coversions on the fly.

^y::                                    ; {LaBonté, 1989 #11}  Transform, utfString, Unicode         ; Retrieve the clipboard's Unicode text as a UTF-8 string  StringTrimLeft, utfString, utfString, 1 ; remove EndNote's braces  StringTrimRight,utfString, utfString, 1  utfString := "[[" . utfString . "]]"  ; sourround with double brackets  Transform, Clipboard, Unicode, %utfString%  Send, ^v                              ; [[LaBonté, 1989 #11]]
return

Hence I decide to keep this function outside of the script and will invoke the AHK script (converted to an exe) at the start of the script. This will establish the shortcut for the function.


Viewing all articles
Browse latest Browse all 3715

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>