This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
[solved]Saving PDF (or anything) to Dropbox in Editorial (path problem...)
cook last edited by cook
I'd appreciate a little help with getting my path stuff to work.
I have a workflow to make a PDF from my current document. What I want is to save the PDF in the current directory, the same as the current document.
In my workflow I have this code. I found this forum post and it seems like this is the right track...but I'm coming up with an error (path/directory doesn't exist) for the save PDF workflow bit.
So, what's the right path?
Here's my code:
#coding: utf-8 import workflow import os params = workflow.get_parameters() #'currentfile' is the path/filename from the workflow part 'get file name' currentp = os.path.split(params['currentfile']) dbpath = os.path.expanduser('~/Library/Application Support/Dropbox').split('private') + currentp + '/' #this works, and reading it works, but it is not in the dropbox directory! Where is it!?? lol with open(dbpath + 'test.txt', 'w') as file: file.write('test') workflow.set_output(dbpath)
cook last edited by
Sorry...I was doing too much. I realized that the Generate PDF Document already had the root of dropbox so I just needed the rest of the path after that.