iOS Shortcut App - Copy/Paste Workflow
I’d like to be able to invoke an iOS shortcut to let me enter a Bible reference, have it find that passage in Logos, copy that passage to the clipboard, and return me to the original app I was in. This way, I could be writing a sermon in my iOS text app (eg. Ulysses, Notes, MS Word, etc), invoke Shortcut, enter Bible reference (eg. John 3:16-18) and have that passage copied from Logos to the clipboard where I can then paste it into my iOS text app.
Does anyone know how to create this functionality via the iOS Shortcuts app and with the iOS Logos App?
Comments
-
Can’t do it in-app yet as Logos doesn’t support it, but this will work if you have an internet connection:
https://www.icloud.com/shortcuts/89f0dcd3eeac4b28a631708764a9cbe6
0 -
Well, -ish. Wondering if I can find a better api for a site with multiple translations to choose from? I dunno. It’s a start.
0 -
Thank you! This is a great start.
Is there any way to have this be the ESV text and not the NET?
0 -
I found this, but I don’t have any API savvy-ness to figure it out: https://api.esv.org/
0 -
I found this, but I don’t have any API savvy-ness to figure it out: https://api.esv.org/
That particular API requires a user key which you get by registering for it. I’m hoping to find something more open/simple than that, but obviously these are copyrighted texts and very few APIs are open in the same way as the NET bible API.
I’m sure that actually obtaining a key wouldn’t be that much of an ordeal but it’s enough to put me off doing it in the short term. The forms are geared around you requesting the API for websites/apps and this is a weird fit for either of those things.
With a bit of effort you could probably use regex to extract the relevant text from the body of a website’s URL, but I can’t work out the ethics of that at the moment. I’m possibly overthinking things.
0 -
Getting a token is super simple. I have one. The API lists personal study as a use case. I think the ethics are fine.
I just don’t know how to get the API invoked via shortcuts. Do I run a python script in the Shortcut (via Pythonista?). Thanks for the help!
0 -
Getting a token is super simple. I have one. The API lists personal study as a use case. I think the ethics are fine.
I just don’t know how to get the API invoked via shortcuts. Do I run a python script in the Shortcut (via Pythonista?). Thanks for the help!
if you want to edit the shortcut I sent you, you just need to work out what format the URL needs to be in order for the reference to work and where the scripture reference fits in - hopefully the URL is the only thing you’d need to change once you’ve found the desired format.
I can’t help with this as I can‘t get an API. The Crossway website won’t let me log in with credentials saved in Safari, won’t let me reset my password and won’t let me create an account the moment, so I’m not able to help.
0 -
Just looking at their website help, you would need to know more than just a URL by the look of it - beyond my ability at the moment, and I can’t learn it if I can’t test it.
0 -
I was able to get a shortcut working based on help found here: https://talk.macpowerusers.com/t/ios-api-shortcut-help/8858
The one issue I have now is how it handles poetry. There are line breaks after each line in poetry and multiple line breaks between poetry paragraphs. I'm trying to find a way to remove those line breaks so the passage is formatted in a single block of text. The "combine text" action doesn't seem to remove the line breaks.
Any ideas?
0 -
Use the "Replace Text" tool with these options:
Find Text: \R
Replace Text: (leave this blank or add a space depending on how the result looks - I dunno if the bible text is gonna have a space before the line break or not)
Case Sensitive: No (probably doesn't matter though?)
Regular Expression: Yes
"\R" is the regex code for a new line, and it's replacing that with... well, nothing. It's just taking it out. You might need to add a space in the replace text thing depending on how it's formatted.
0 -
Great advice.
I had to change the find text to \n because that is what the API had as line breaks. Thank you!
0 -
Great advice.
I had to change the find text to \n because that is what the API had as line breaks. Thank you!
Ah, good work - I only started learning Regex stuff since iOS 12 came out and I'm still finding my feet. Finally got a password reset email from Crossway just now, so I might not be far behind you!
0 -
Would you be able to share the shortcut? I asked you the same thing on the Mac power users forum. This would be super helpful to a lot of people.
0 -
-
This is very helpful. Is there a way that you could copy and paste that URL into a post?
0 -
Here you go:
https://api.esv.org/v3/passage/text/?q=URL Encoded Text&include-verse-numbers=false&include-passage-references=true&include-headings=false&indent-poetry=false&indent-paragraphs=0&indent-declares=0&indent-psalm-doxology=0&include-footnotes=false
0 -
Thanks for posting this. I built the shortcut, but I don’t see a place to use my ESV api number. I get an error message that says {“detail”: “Authentication credentials were not provided.”}
any ideas for what should be modified?
0 -
What is that large space under the URL encode step near the beginning?
Check out the shortcut I built! https://www.icloud.com/shortcuts/97edac586637449a8292e8d98e3e358d
0 -
I added the encoded text magic variable into the main URL. Still not sure what to do with the API.
0 -
OK, I made some progress. I figured out that you have to use “Show more” under the “Get contents” step and put in your API key as an authorization header.
Now, the clipboard contents looks like this:
{"passages":["James 1:4\n\nAnd let steadfastness have its full effect, that you may be perfect and complete, lacking in nothing. (ESV)"],"query":"James 1:4","parsed":[[59001004,59001004]],"canonical":"James 1:4","passage_meta":[{"chapter_start":[59001001,59001027],"prev_verse":59001003,"prev_chapter":[58013001,58013025],"canonical":"James 1:4","chapter_end":[59001001,59001027],"next_verse":59001005,"next_chapter":[59002001,59002026]}]}
How do I clean that up? Is there are regular expression to delete everything after (ESV)?
I have a step to replace \n with a blank space, but that may need to be repeated several times. I am not sure.
https://www.icloud.com/shortcuts/0b945901d3a4435baeeaa02715bd1033
This will be a major help if I can figure it out. Thanks!
0 -
Are you missing this step?
- Get "Value" for "passages" in "contents of URL"
That step comes after the Get contents of "URL (check the screen shots I put earlier in this thread.
I think that formats the search properly. After this step is when I run the Replace "\n" with " " in "Dictionary Value."
0 -
Thanks so much. I didn’t realize I missed that step, but that is the fix. I can share the shortcut with anyone who is interested.
0 -
Hi, if you still have this, I’d like the shortcut.
0 -
https://www.icloud.com/shortcuts/355adeff99ef46afa67092741656f357
here is the link. you just need to type in the passage in the form of John 1:1-5 and it can copy and paste any length of text.
I use this as a subshortcut in other shortcuts like scripture memory and sending Bible study emails.
0 -
Brilliant! Thank you! Big help!
0 -
This is just what I was looking for! Do you think there is a possibility of using other versions? Like the CSB or a Greek version?
0 -
I’m not sure if the CSB has an API access like the ESV does (api.esv.org).
0 -
I came across this:
0 -
That doesn’t include the CSB. You can see what they have for English Bibles here: https://docs.api.bible/docs/bibles-1
0 -
For a more robust solution, I recommend using python and Pythonista on iOS. I made a script that will take a highlighted passage and retrieve it. To do this, I use the `requests` and `beautifulsoup4` packages to sign in to my Logos account on Biblia.com and essentially scrape the text from that verse. This can be done on any Bible site, but by logging in, I get access to the versions I own. After I scrape the content, I format it for my purposes (multimarkdown) and paste it back into my editor. Pythonista has an iOS keyboard that lets me assign scripts as buttons. Essentially, I select a passage, push the button, wait for a second, and the passage gets pasted into my document. I wish the Logos API was useful and that the URL scheme was too, but since they are not, I had to get creative.
0