Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflows for Shortcuts API #804

Open
treyharris opened this issue Sep 27, 2019 · 3 comments
Open

Workflows for Shortcuts API #804

treyharris opened this issue Sep 27, 2019 · 3 comments
Labels
feature Feature requested by users

Comments

@treyharris
Copy link

As requested on Discord, @yury and @carloscabanero have requested examples of workflows for the interprocess API replacing x-callback-url. I will add one as a comment and perhaps others will do the same.

@treyharris
Copy link
Author

Retrieve file from host and edit it

Current non-automated workflow (ALLCAPS means expansion of previously-mentioned lowercase thing):

  1. Identify filepath on remote host called hostname.
  2. Open new Blink shell
  3. cd tmp/FORMAT (my own directory for these files so I can keep track, where format may be markdown, html, etc.)
  4. scp HOSTNAME:FILEPATH .
  5. Truncate FILEPATH to basename.
  6. open BASENAME
  7. Select “Save to Files”
  8. Select “On My iPad” → Editor program (e.g., Byword for Markdown or Slugline for Fountain)
  9. Some programs this causes the editor to open, some programs this does not. If the editor does not open, open it (and find the file just mentioned).
  10. *When I go back to Blink, the open dialog sheet is still there and I must tap outside it to dismiss. This may be a bug?

Upload file back to host

Assuming load-command is the program I run on the remote host to restart my server or cause file ingestion or whatever I need to do with the newly-edited file:

  1. Use Files to copy or move file from editor to “On My iPad” → “Blink” → “tmp” → “markdown” (or “fountain” or “html” or whatever, but again, this subdirectory structure is my personal taste)

    I expect it to overwrite the file copied in the earlier download task, but don’t want a fat-finger or Siri mistaken hearing to cause a file to get overwritten accidentally. I don’t know how to best handle this. Confirming every time is annoying, but less annoying than writing to a new filename since I then have to do manual intervention to fix this.

  2. Open a new Blink shell
  3. cd tmp/FORMAT
  4. scp BASENAME HOSTNAME:FILEPATH
  5. ssh HOSTNAME LOAD-COMMAND

@treyharris
Copy link
Author

treyharris commented Sep 27, 2019

Load Swift Playground

This one I don’t think I need to go into step-by-step detail, but if I want to use Swift Playgrounds for a Playground I’ve developed in Xcode, I need to scp it to the iPad and then put it into Swift Playgrounds’ file space and open it. Unlike the prior example, this is one-way.

I’m sure Apple would like me to do this by connecting my iPad to the Mac, but this way I can do it wirelessly and even remotely.

@bradleyjones
Copy link
Contributor

I’d also like to see this implemented. Initial use case I can think of is a shortcut that starts a local port forward to an address then opens that address in safari once the connection has been made.

@javierdemartin javierdemartin added the feature Feature requested by users label Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature requested by users
Projects
None yet
Development

No branches or pull requests

3 participants