GetClip.mac:
FUNCTION MAIN() {
STRING bat= macro_path(0)+"\getClip.bat"
STRING file1= macro_path(0)+"\getClip.txt"
STRING file2= macro_path(0)+"\getClip.OK"
IF file_exists($file1) {
DELETE FILE $file1
}
IF file_exists($file2) {
DELETE FILE $file2
}
STRING cmd='powershell -command "Get-Clipboard" >"'+$file1+'"' +crlf+'ECHO OK >"'+$file2+'"'
FILE OPEN $bat FOR WRITE AS "output"
FILE WRITE $cmd TO "output"
FILE CLOSE "output"
OLE FILEACTION "OPEN" $bat
WHILE NOT file_exists($file2) {
INT I=0
}
STRING Clipboard=""
FILE OPEN $file1 FOR READ AS "file1"
FILE READ $Clipboard FROM "file1"
FILE CLOSE "file1"
DELETE FILE $file1
DELETE FILE $file2
print=$Clipboard
}
ToClip.mac: - for entity context menu - such as model
FUNCTION MAIN(STRING S ) {
STRING P= macro_path(0)+"\ToClip.bat"
STRING CLIP="ECHO | SET /P=" +$S+" | CLIP"
FILE OPEN $P FOR WRITE AS "output"
FILE WRITE $Clip TO "output"
FILE CLOSE "output"
OLE FILEACTION "OPEN" $P
}