I put the code below, and the output that I kept getting. Note, Copy() and Paste() are printed by Clarisse and not my code.
- Code: Select all
def copy_and_paste(ix, item_path, dest_path):
"""Copy and paste and item in Clarisse
Arguments:
ix: The Clarisse api
item_path (str): The path to the item to copy
dest_path (str): The path to where to put the copy
"""
# Get the current context to set back when done
ctx = str(ix.get_current_context())
# Select the item to copy, and copy
ix.selection.select(item_path)
ix.application.copy()
# Select where the item will be pasted, and paste
ix.set_current_context(dest_path)
ix.selection.select(dest_path)
print "About to paste"
ix.application.paste()
print "Paste Finished"
# Put the selection back where it was
ix.set_current_context(str(ctx))
print "Done copy and paste"
Output:
- Code: Select all
Copy()
About to paste
Paste Finished
Done copy and paste
Paste()
That paste is done way after I need it, and not where it should be happening, which is between "About to Paste" and "Paste Finished".
Thanks in advance!