Hello!
I’m trying to take clipboard value and, if it’s a number, let my code use it.
But I’m getting stuck over initial if statement, failing at decision, if the clipboard string is a number or not.
Would anyone know how to get this to work?
Thank you!
tempintvalue = int(bpy.context.window_manager.clipboard)
if tempintvalue is int:
self.message(f'test1')
outcome_value = int(bpy.context.window_manager.clipboard)
else:
self.message(f'test2')
outcome_value = 0
The code above gives me following error
tempintvalue = int(bpy.context.window_manager.clipboard)
ValueError: invalid literal for int() with base 10: 'tfdfew'
“tfdfew” is a random clipboard value that should be ignored in this case