Shift+Ctrl+V in Python in a text note

Hi,
I had seen a tip relayed by Mr. Poupin on his blog
In your opinion, is it possible to automate this collage part in a textnote.
Do you know any Python resources that go in this direction?
sending the contents of the clipboard.
My python knowledge is improving a little, even if I still have big gaps.
Sincerely
christian.stan

1 Like

@christian.stan ,

that looks great, but i still struggle only to read excel. For any reason i find the file… …i am not sure if this is out of the topic, but open excel via Python seems to be challange. I avoid using Pandas.

# 🎹 modules
import subprocess

clr.AddReference("Microsoft.Office.Interop.Excel")
from Microsoft.Office.Interop import Excel
from System.Runtime.InteropServices import Marshal

# 🧪 Test Unit:

# 💡 Specify the path to your Excel file
excel_file_path = 'C:/Users/andre/Downloads/test_V01.xls'

# ✅ Check if the file exists
if os.path.exists(excel_file_path):
    # Determine the default application associated with .xls files
    os.startfile(excel_file_path)
else:
    print("File not found:", excel_file_path)


# 📃 get file

path = "C:/Users/andre/Downloads/test_V01.xls"

ex = Excel.ApplicationClass()
ex.Visible = False
ex.DisplayAlerts = False

# 📖 get Workbook
workbook = ex.Workbooks.Open(path)
print(workbook)

i have excel installed, but not working (expired license). Only Open Office.

To copy/paste a excel is pretty impresive (as shown in the link)

1 Like

I’m going to have to learn a lot more
thank you for supporting
Sincerely
christian.stan

Look at this link
edit: this one too @Draxl_Andreas
Sincerely
christian.stan

Clockwork has a ‘send to’ and ‘read from’ node that works with Python 2. Haven’t tried 3 yet.

2 Likes

hi, thanks,
I’ll watch this Friday
Sincerely
christian.stan

The Clockwork Clipboard nodes only work with singleton strings. Won‘t help in this case, I think.

3 Likes

Hi,

with a Dynamo workflow, rather than a textNote I would rather lean towards a dummy Schedule a bit like TableGen from DiRoots does

on the other hand, importing/copying a selection from Excel requires working with Excel Interrop

1 Like

Hi, thanks for the advice but I will need to create several ranges of cells from Excel, and launch TableGen several times
By losing the automation side

I think I have to face the facts, I don’t yet have the level to undertake this kind of work.

thanks
Sincerely
christian.stan

Unfortunately, it appears that TextNote styling is not fully exposed to the API like background colors.

1 Like