I'm a newbie when it comes to Python, but I'm learning..
I'm trying to make an event that watches my Dropbox screenshot directory for new files, and when one is created, take that file path and copy it to the Clipboard. When I try to set the clipboard to {eg.event.payload} of Directory Watch, I get the path, but it isn't quite right... Instead of getting C:\\Documents and Settings\\Cloud\\Desktop\\DROPBOX\\Dropbox\\Screenshots\\ScreenshotFileName.png, I'm getting (u'C:\\Documents and Settings\\Cloud\\Desktop\\DROPBOX\\Dropbox\\Screenshots\\ScreenshotFileName.png',)
The bolded text is what I want removed from the path string, but I'm unsure how to do that. I tried adding a Python script that assigns the Payload to a variable, then snips the first and last two characters... but the script doesn't seem to work and it gives me errors. The script is simply:
Code: Select all
dirtypath = (eg.event.payload)
cleanpath = dirtypath[2:-2]