Copy link to clipboard
Copied
Hello
I haven't found an easy solution here to work with the clipboard contents by placing it in a variable, to modify it. Using paste() it will be placed in the document. But first I want to format it and delete some of its parts.
Regards
Copy link to clipboard
Copied
Create TextFrame, paste clipboard, read contents - do what you need.
Copy link to clipboard
Copied
(...and after all delete the TextFrame.)
Only this workaround is possible?
Copy link to clipboard
Copied
It should be possible in official / latest version of JS - but InDesign's version is limited and outdated - and I'm not JS guy, sorry.
Copy link to clipboard
Copied
No problem. Thanks for your answer.
Copy link to clipboard
Copied
You're welcome.
Copy link to clipboard
Copied
Okay, I did that. But I realized this way I couldn't do what I wanted:
1. I copy some values from a PDF in Acrobat
2. I select one or more cells in a table in InDesign
3. I paste the (edited) content of my clipboard into the table/cells
This would not work in the workflow if I let InDesign create a TextFrame first. Then my selection is lost.
Copy link to clipboard
Copied
Rememmber your selection first.
Create a new, invisible document - work there - close - go back to your original document.
Selection in InDesign is per Document.
There is always more than one way to skin the proverbial cat 😉
Copy link to clipboard
Copied
What do you mean by “remember”? 😞
Copy link to clipboard
Copied
What do you mean by “remember”? 😞
By @_AWID_
You can save selection to a variable:.
var myCurSel = app.activeDocument.selection;
"selection" is a collection like everything else - Stories, Tables, TextFrames, etc.
Copy link to clipboard
Copied
it looks like a good option 🙂
I´ll try as soon as I can. Thanks
Copy link to clipboard
Copied
On some platforms, clipboard operations are available from the platform scripting system.
var text = app.doScript("the clipboard as text",ScriptLanguage.APPLESCRIPT_LANGUAGE);
On other platforms, search recommends to use the HTMLFile object.
https://stackoverflow.com/questions/19696308/how-can-i-use-clipboard-in-vbscript
Copy link to clipboard
Copied
Yes, on Windows, in VB6 it's built-in.
Copy link to clipboard
Copied
I actually work on a Mac.
Copy link to clipboard
Copied
Here's how to get the clipboard contents.