Workflow help - transmitting files via SSH
I'm trying to put together a workflow and I'm a bit stuck (mainly because I can't figure out how to send/receive files to/from a remote server via Run Script via SSH).
NB: I've also sent this post to the Workflow team as an email. If I get a response I'll be sure to update this thread 😊
Background
I have a bunch of Latex files (.tex) and an associated makefile stored in a repo in the Working Copy app on my iPad. I want to send these to a remote server (which I control) and then run make to compile them to PDF, then pull that PDF back to my iPad to view it.
Proposed Workflow
- Compose an x-callback-url which uses Working Copy's URL scheme to bundle the relevant files into a base64 encoded zip and then return to Workflow.
- This step works great. I can even decode the zip and view the files and their contents in Workflow via Quicklook.
- Copy the files to my remote server.
- I don't seem to be able to do this.
- Run Script via SSH takes a file as input but I can't figure out how to write the script in the action block such that the input file is actually available to the remote server.
- I also tried using the Save with Transmit action (as I've already set up SFTP access to my server in Transmit) but this action straight-up does nothing. No matter what I do the input zip file isn't saved anywhere. I even tried configuring the action to save it to Transmit's local directory, but again nothing happened (the files were not saved).
- Interestingly if I use the Save File action, manually select Transmit from the iCloud Document Picker, and then manually select a location on my remote server the zip is uploaded correctly. Weird.
- I also tried sending the zip into Run Script via SSH as still-encoded base64 text (with the intention of having the server decode the string and write the files to disk) but I get an error from Workflow: "4294967262 - Unable to send channel request".
- Execute make on the remote server to generate the PDF from the .tex files.
- I can do this no problem. Already have this up and working in another workflow.
- Copy the generated PDF back to my iPad to view in Quicklook.
- I can do this via Dropbox (ie: use Run Script via SSH to copy the PDF to Dropbox on my server, which will then sync it back to Dropbox's servers, which will sync the PDF to Dropbox on my iPad, where Workflow will eventually be able to find it). But this isn't great as it takes a little bit of time for my iPad to automatically do a sync with Dropbox.
- Run Script via SSH has a (file) output, but I can't figure out how to actually get it to send a file (in this case the generated PDF) back to my iPad.
I'd appreciate any help you can give me.
Posted May 27, 2016, 4:53 AM UTC · edited
310