How do I copy some text to the clipboard from Mechanical?

Member, Moderator, Employee Posts: 108
25 Answers Second Anniversary 10 Comments 25 Likes
✭✭✭✭
edited June 2023 in Structures

How can we make some text available to the user from the clipboard?

Tagged:

Answers

  • Administrator, Employee Posts: 303
    Ancient Membership 100 Comments 100 Likes 25 Answers
    admin

    Hi @Pierre Thieffry Can you move your answer to an answer and accept it please? At the moment this question looks unanswered so people aren't likely to realise it is a solved problem!

  • Member, Moderator, Employee Posts: 108
    25 Answers Second Anniversary 10 Comments 25 Likes
    ✭✭✭✭
    Answer ✓

    Fairly simple code...

    1. clr.AddReference('System.Windows.Forms')
    2. from System.Windows.Forms import Clipboard
    3.  
    4. Clipboard.SetText('My text to the clipboard)

Welcome!

It looks like you're new here. Sign in or register to get started.