Jump to content


Photo

Paste into any app without opening Accordance


  • Please log in to reply
25 replies to this topic

#1 [email protected]

[email protected]

    Member

  • Active Members
  • Pip
  • 10 posts

Posted 10 October 2018 - 04:01 PM

Accordance has a service where you can paste Bible verses into any app. I've written an improved version that suits me when I'm writing talks and need to paste in lots of references. 

 

Here's what it looks like:

pasteverses.jpg

 
Once it's installed you simply:
 
1. Press Apple-7 from any application.
2. Type the verse you want.
3. It will paste the verse from accordance into that app.
 
You can download it from here:

https://macintoshhow...-processor.html

 

Feel free to use it, change it, etc. There's a 'Quick Action' version that you can use, or if you are a programmer there's an AppleScript version that you can customise.

 

It's a bit like the built in services in Accordance except (1) it brings up a dialog asking for the verse that you need and (2) It remembers the last verse that you typed.
 
I'm happy for any feedback. [email protected]

Attached Files


Edited by [email protected], 10 October 2018 - 04:03 PM.

  • R. Mansfield, Rich, OSchrock and 2 others like this

#2 Joe Weaks

Joe Weaks

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,336 posts
  • Gender:Male
  • Location:Odessa, TX
  • Interests:I like things that are Orange, and possibly Blue.
  • Accordance Version:11.x

Posted 14 October 2018 - 12:29 AM

Wayne,

 

I just wanted to say don't get discouraged at no responses. For over a decade I've been putting scripts out there for Accordance users (such as this post over a decade ago) and sometimes you feel on an island. Those were a library of scripts for Quicksilver, Launchbar, Butler, and eventually part of the Automator Workflows they have now.

 

Keep fighting the good [automated] fight.


Joe Weaks
The Macintosh Biblioblog

Sometimes I'm so helpful even I can't stand it.

#3 rcdeacon

rcdeacon

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,100 posts
  • Gender:Male
  • Location:Murfreesboro, North Carolina
  • Interests:Bible, computers
  • Accordance Version:12.x
  • Platforms:Mac OS X, Windows, iOS, Android

Posted 14 October 2018 - 07:02 AM

Wayne,

 

Is there a way to change the translation? I have downloaded "other versions" but I actually use the CSB 17. Did not know if there is an easy way to change the translation.

 

Bob


Bob Deacon2017 MacBook Air, Accordance 12MacOs 10.14 Mojave Public BetaIpad Air 2IOS 12 Public BetaMotorola G6 Play AndroidDell Inspiron laptop, Windows 10 Spring 2018 EditionPastorBuckhorn Baptist Church<p>Como, NC

#4 JohnABarnett

JohnABarnett

    Gold

  • Active Members
  • PipPipPipPip
  • 282 posts
  • Gender:Male
  • Location:San Antonio, TX
  • Interests:Biblical studies
    History and music
    τα παντα
  • Accordance Version:12.x
  • Platforms:Windows, iOS

Posted 14 October 2018 - 07:26 AM

Is there a maximum number of verses?


PC, WIndows 10

Primary Interest: Original Language Exegetical Work


#5 Joe Weaks

Joe Weaks

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,336 posts
  • Gender:Male
  • Location:Odessa, TX
  • Interests:I like things that are Orange, and possibly Blue.
  • Accordance Version:11.x

Posted 14 October 2018 - 08:40 PM

Is there a way to change the translation?

 

After you install the Service, you can open the file in "/Library/Services/" with the Automator.app and then find the 9th line that says:

set theModulename to "NIV"

and change it to 

set theModulename to "CSB"

or whatever.


Joe Weaks
The Macintosh Biblioblog

Sometimes I'm so helpful even I can't stand it.

#6 Ιακοβ

Ιακοβ

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 668 posts
  • Gender:Male
  • Location:Australia
  • Interests:Studying MDiv. Greek. Hebrew.
  • Accordance Version:11.x
  • Platforms:Mac OS X, iOS

Posted 15 October 2018 - 03:16 AM

This gets me thinking... at least several times a week, I find myself looking at a verse and wanting to know "how is this specific verse rendered in all other translations I have access to". This question almost always pops up when I am not at my computer. (i.e. Today I was reading a commentary and wanted to see how all translations handle the variant in John 3:13) Sadly this cannot be done on iPhone/iPad. It is possible spend 10 minutes or so flicking through each translation one by one copying out the text of each verse into notepad or something, but that is quite time consuming!

 

You are making me think that this type of thing could be automated, i.e. perhaps I could probably set up something where I "email my computer at home with subject line 'LOOKUP John 3:13'", and then "my computer picks up the email", "pulls the verses", and "emails the verses back" Maybe its time I finally learn the mac automation tools. (I usually only do command line stuff)


Edited by Ιακοβ, 15 October 2018 - 03:19 AM.

My top 5 feature requests:
  1. 15pt font size for reading text (bible, journal articles, commentaries, etc...)
  2. Improved searching for Journal articles. (So we can search for journal article by verse + english text)
  3. Display Journal titles in journal search results. (Imagine a google search where you saw the page text but no headings?)
  4. Improved greek text search—i.e. allow searching of all greek text the same way you would search LXX+NT, i.e. LXX+NT+ApocFathers+etc...
  5. Phrase (sympathetic) highlighting.

#7 Joe Weaks

Joe Weaks

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,336 posts
  • Gender:Male
  • Location:Odessa, TX
  • Interests:I like things that are Orange, and possibly Blue.
  • Accordance Version:11.x

Posted 15 October 2018 - 11:21 AM

…perhaps I could probably set up something where I "email my computer at home with subject line 'LOOKUP John 3:13'", and then "my computer picks up the email", "pulls the verses", and "emails the verses back"…

 

The short answer is, yes, you can do that using the normal Mail.app trigger rules with a perform action: Run Applescript.


  • Ιακοβ likes this
Joe Weaks
The Macintosh Biblioblog

Sometimes I'm so helpful even I can't stand it.

#8 Ιακοβ

Ιακοβ

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 668 posts
  • Gender:Male
  • Location:Australia
  • Interests:Studying MDiv. Greek. Hebrew.
  • Accordance Version:11.x
  • Platforms:Mac OS X, iOS

Posted 17 October 2018 - 05:21 PM

The short answer is, yes, you can do that using the normal Mail.app trigger rules with a perform action: Run Applescript.

 

Thanks! Learning AppleScript will have to go on my list of things to do after my thesis is submitted.  


My top 5 feature requests:
  1. 15pt font size for reading text (bible, journal articles, commentaries, etc...)
  2. Improved searching for Journal articles. (So we can search for journal article by verse + english text)
  3. Display Journal titles in journal search results. (Imagine a google search where you saw the page text but no headings?)
  4. Improved greek text search—i.e. allow searching of all greek text the same way you would search LXX+NT, i.e. LXX+NT+ApocFathers+etc...
  5. Phrase (sympathetic) highlighting.

#9 OSchrock

OSchrock

    Silver

  • Active Members
  • PipPipPip
  • 133 posts
  • Gender:Male
  • Location:USA / Brazil
  • Accordance Version:12.x
  • Platforms:Mac OS X

Posted 17 October 2018 - 07:30 PM

This is great! Thank you! I'm a big fan of automation and love how Accordance works so smoothly with AppleScript and Services! 



#10 Martin Zhang

Martin Zhang

    Gold

  • Active Members
  • PipPipPipPip
  • 492 posts
  • Gender:Male
  • Accordance Version:12.x
  • Platforms:Mac OS X, Windows, iOS

Posted 18 October 2018 - 05:35 AM

This is very helpful! Thanks!


Martin
Accordance v.12
MacOS High Sierra
iOS 11
Win10 Pro
Android? ??
Accordance tutorials in Chinese.

#11 rcdeacon

rcdeacon

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,100 posts
  • Gender:Male
  • Location:Murfreesboro, North Carolina
  • Interests:Bible, computers
  • Accordance Version:12.x
  • Platforms:Mac OS X, Windows, iOS, Android

Posted 18 October 2018 - 08:26 AM

My density level must be high! I have installed and I have assigned the shortcut and it works BUT I have been unable to modify the file to have the CSB as the text. I opened automator but cannot find the "workflow" or whatever it is called in order to modify line 9. Any help would be greatly appreciated. Sorry.

 

Bob


Bob Deacon2017 MacBook Air, Accordance 12MacOs 10.14 Mojave Public BetaIpad Air 2IOS 12 Public BetaMotorola G6 Play AndroidDell Inspiron laptop, Windows 10 Spring 2018 EditionPastorBuckhorn Baptist Church<p>Como, NC

#12 Joe Weaks

Joe Weaks

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,336 posts
  • Gender:Male
  • Location:Odessa, TX
  • Interests:I like things that are Orange, and possibly Blue.
  • Accordance Version:11.x

Posted 18 October 2018 - 11:48 AM

Bob, files for Services are located at:

~/Library/Services/

 

If you go to "Finder", click the "Go" menu, then press the "Option" key and the normally-hidden "Library" folder will be revealed. Click it to open that folder and then find the "Services" folder inside it.


Joe Weaks
The Macintosh Biblioblog

Sometimes I'm so helpful even I can't stand it.

#13 rcdeacon

rcdeacon

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,100 posts
  • Gender:Male
  • Location:Murfreesboro, North Carolina
  • Interests:Bible, computers
  • Accordance Version:12.x
  • Platforms:Mac OS X, Windows, iOS, Android

Posted 18 October 2018 - 01:22 PM

Joe,

 

Thanks for the reply. I actually had trouble determining which service it was.

 

Bob


Bob Deacon2017 MacBook Air, Accordance 12MacOs 10.14 Mojave Public BetaIpad Air 2IOS 12 Public BetaMotorola G6 Play AndroidDell Inspiron laptop, Windows 10 Spring 2018 EditionPastorBuckhorn Baptist Church<p>Como, NC

#14 Ιακοβ

Ιακοβ

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 668 posts
  • Gender:Male
  • Location:Australia
  • Interests:Studying MDiv. Greek. Hebrew.
  • Accordance Version:11.x
  • Platforms:Mac OS X, iOS

Posted 18 October 2018 - 09:12 PM

Sadly it doesn't work for me.  I have tried altering the script a few times to fix it, to one of the following:

 

tell application "System Events" to tell (1st process whose frontmost is true) to keystroke "v" using {shift down, option down, command down}

 
tell application "System Events" to tell (1st process whose frontmost is true) to keystroke "v" using command down
 
tell application "System Events" to keystroke "v" using {command down}

Edited by Ιακοβ, 18 October 2018 - 09:14 PM.

My top 5 feature requests:
  1. 15pt font size for reading text (bible, journal articles, commentaries, etc...)
  2. Improved searching for Journal articles. (So we can search for journal article by verse + english text)
  3. Display Journal titles in journal search results. (Imagine a google search where you saw the page text but no headings?)
  4. Improved greek text search—i.e. allow searching of all greek text the same way you would search LXX+NT, i.e. LXX+NT+ApocFathers+etc...
  5. Phrase (sympathetic) highlighting.

#15 Ιακοβ

Ιακοβ

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 668 posts
  • Gender:Male
  • Location:Australia
  • Interests:Studying MDiv. Greek. Hebrew.
  • Accordance Version:11.x
  • Platforms:Mac OS X, iOS

Posted 19 October 2018 - 06:32 PM

To be clear, when I say "It doesn't work" what I mean is, the thing runs, but then it doesn't do the last step (paste). I have to then do a manual paste to get the last step to work. But apart from that, it's great.


My top 5 feature requests:
  1. 15pt font size for reading text (bible, journal articles, commentaries, etc...)
  2. Improved searching for Journal articles. (So we can search for journal article by verse + english text)
  3. Display Journal titles in journal search results. (Imagine a google search where you saw the page text but no headings?)
  4. Improved greek text search—i.e. allow searching of all greek text the same way you would search LXX+NT, i.e. LXX+NT+ApocFathers+etc...
  5. Phrase (sympathetic) highlighting.

#16 Martin Zhang

Martin Zhang

    Gold

  • Active Members
  • PipPipPipPip
  • 492 posts
  • Gender:Male
  • Accordance Version:12.x
  • Platforms:Mac OS X, Windows, iOS

Posted 19 October 2018 - 09:43 PM

I downloaded the script for Keyboard Maestro. It works great!

I usually copy from only one version.

The benefit is that once the source version is set up, I don't have to choose it every time.

If I need another version, I can use the official Get Verse service.


Martin
Accordance v.12
MacOS High Sierra
iOS 11
Win10 Pro
Android? ??
Accordance tutorials in Chinese.

#17 Graham Buck

Graham Buck

    Gold

  • Accordance
  • 410 posts
  • Gender:Male
  • Location:God's Country (New England)
  • Accordance Version:12.x
  • Platforms:Mac OS X, iOS

Posted 20 October 2018 - 01:01 AM

In case anyone is interested, I've made a few adjustments to the script, allowing run-time selection of text and citation style. As, Martin just mentioned above, you can use the built in Get Verses service, if you have Accordance open, to select module and reference. With the adjustments below you need not have Accordance open to have access to the same options.

# Applescript to paste verses from Accordance into the frontmost application
# by Wayne Connor - https://macintoshhowto.coma
# 
# You can access this from any app (Word, Pages, mail etc)
# Press Apple-7, type the verse you want, and it will be pasted into you app.
#

# There are a few options on how to access this script easily 
# 1. Assign it to a kotkey (I use Command - 7) usign Keyboard Maestro
# 2. Use the automator workflow Quick Action and assign it to Command 7 hotkey using
#    System Preferences: Keyboard: Shortcuts: Services 
#     and assign a shortcut key to  Paste Bible Verses
# 3. Use it as a Moicrosoft Word add-on
#

set theModulename to ""
set theVerseref to ""
set theCitationformat to ""

try
	tell application "Finder"
		set textList to name of files of folder ((path to home folder as text) & "Library:Application Support:Accordance:Modules:Texts:")
	end tell
	
	set sortedList to simple_sort(textList)
	choose from list sortedList with prompt "What text would you like?"
	if the result is not false then
		set theModulename to item 1 of the result
		set theModulename to remove_extension(theModulename)
	end if
	
	if theModulename is "" then
		error
	end if
	
	tell application "System Events"
		set refResult to display dialog "Verse Reference (eg John 1:1)" default answer theVerseref buttons {"Cancel", "Without Citation Format", "With Citation Format"} with icon path to resource "application.icns" in bundle (path to application "Accordance")
	end tell
	
	set theVerseref to text returned of refResult
	
	if button returned of refResult is "With Citation Format" then
		set theCitationformat to "true"
	end if
	if button returned of refResult is "Without Citiation Format" then
		set theCitationformat to "false"
	end if
	
	
	if theVerseref is not "" then
		tell application "Accordance" to set theText to «event AccdTxRf» {theModulename, theVerseref, theCitationformat}
	else
		set theText to ""
	end if
	
	if text 1 thru 3 of theText is "Err" then
		display dialog "Sorry I don't recognise that verse format. 
Please use format your verse like this: 
John 3
John 3-5
John 3:16
John 3:16-18
1 John 2
" & theText with icon caution
		set theText to ""
	end if
	
	set the clipboard to theText
	
	activate application (path to frontmost application as text)
	tell application "System Events" to tell (1st process whose frontmost is true) to keystroke "v" using {shift down, option down, command down}
	
	
end try

on simple_sort(my_list)
	set the index_list to {}
	set the sorted_list to {}
	repeat (the number of items in my_list) times
		set the low_item to ""
		repeat with i from 1 to (number of items in my_list)
			if i is not in the index_list then
				set this_item to item i of my_list as text
				if the low_item is "" then
					set the low_item to this_item
					set the low_item_index to i
				else if this_item comes before the low_item then
					set the low_item to this_item
					set the low_item_index to i
				end if
			end if
		end repeat
		set the end of sorted_list to the low_item
		set the end of the index_list to the low_item_index
	end repeat
	return the sorted_list
end simple_sort

on remove_extension(this_name)
	if this_name contains "." then
		set this_name to ¬
			(the reverse of every character of this_name) as string
		set x to the offset of "." in this_name
		set this_name to (text (x + 1) thru -1 of this_name)
		set this_name to (the reverse of every character of this_name) as string
	end if
	return this_name
end remove_extension

This will give you an alphabetically sorted list of all text modules in your library and then give you the option to use citation formatting or not.

 

Caveats: 1) I did this to learn some AppleScript. I make no claim to have any expertise. 2) there is a slight delay if you have a large library as AS doesn't have a built in sort function and this one above is slow. 3) Regarding two, I don't think there is an Acc event that one can query about library items, but if so, that would be much faster. 4) AS gives no control over dialog sizes, so with a large library the window is… long. And finally 5) why would you ever not have Accordance open so as to have to lower your standards to this (a claim made only about my additions, the original is slick and efficient, and I thank Wayne greatly for his time in programming and heart in sharing).


Edited by Graham Buck, 20 October 2018 - 01:08 AM.

Graham Buck

iOS Programmer
Content Development [Ninja]
OakTree Software


#18 OSchrock

OSchrock

    Silver

  • Active Members
  • PipPipPip
  • 133 posts
  • Gender:Male
  • Location:USA / Brazil
  • Accordance Version:12.x
  • Platforms:Mac OS X

Posted 20 October 2018 - 12:51 PM

In case anyone is interested, I've made a few adjustments to the script, allowing run-time selection of text and citation style. ...

 

This is really neat. Thank you for your work on it! Would there be any way to select multiple texts so as to do a translation comparison?



#19 Graham Buck

Graham Buck

    Gold

  • Accordance
  • 410 posts
  • Gender:Male
  • Location:God's Country (New England)
  • Accordance Version:12.x
  • Platforms:Mac OS X, iOS

Posted 20 October 2018 - 12:53 PM

This is really neat. Thank you for your work on it! Would there be any way to select multiple texts so as to do a translation comparison?

 

Considering what Joe said before about the mail AppleScript trigger, I'm trying to figure that out. I think it'd be neat to grab the contents of a text browser. I would require Acc to be open to snag the contents of the browser. AccdTxRf doesn't work on multiple resources.


Edited by Graham Buck, 20 October 2018 - 12:55 PM.

  • OSchrock likes this

Graham Buck

iOS Programmer
Content Development [Ninja]
OakTree Software


#20 Graham Buck

Graham Buck

    Gold

  • Accordance
  • 410 posts
  • Gender:Male
  • Location:God's Country (New England)
  • Accordance Version:12.x
  • Platforms:Mac OS X, iOS

Posted 20 October 2018 - 04:03 PM

In response to above: https://www.accordan...dance/?p=121647

 

Ok, here's what I've got:

-- Set variables
set theTexts to {}
set theResults to {}

-- Get information from Mail
tell application "Mail"
	set theQuery to (first message of inbox whose read status is false and subject contains "LOOKUP")
	set theSubject to subject of theQuery
	set theAddress to sender of theQuery
end tell

-- Parse the Subject
-- Turn subject into a list
set text item delimiters to "*"
set theItems to (every text item in theSubject) as list
-- Get the reference
set text item delimiters to "; "
set theRefs to (every text item in item 2 of theItems) as list
-- Get the translations you want
set text item delimiters to ", "
set theTexts to (every text item in item 3 of theItems) as list


-- Get data from Accordance
repeat with theReference in theRefs
	repeat with theModulename in theTexts
		tell application "Accordance Aleph" to set theText to «event AccdTxRf» {theModulename, theReference, "true"}
		copy theText & "\n" to the end of theResults
	end repeat
end repeat

-- Concatenate result list into a single string
set theResultsText to ""
repeat with theTrans in theResults
	set theResultsText to theResultsText & theTrans
end repeat

-- Generate reply email
tell application "Mail"
	set theMessage to make new outgoing message with properties {subject:"RESULTS of " & theRefs, content:theResultsText}
	tell theMessage
		make new to recipient with properties {address:theAddress}
		send
	end tell
	tell theQuery
		set deleted status to 1
	end tell
end tell

Just save the script to ~/Library/Application Scripts/com.apple.mail and set up a rule in Mail.

 

Attached File  Screen Shot 2018-10-20 at 5.06.19 PM.png   454.46KB   0 downloads

 

You create an email with these items in the subject, separated by an asterisk '*'

1. LOOKUP - the key word

2. the verse reference, or references you desire, separated by a semicolon

3. the translations you want search, delimited by a comma

 

So, for example: LOOKUP*Gen 2.2-4; Rev 5.1-3*NIV11-GKE, NRSVS, NLT-SE, NET

 

And you'll get a reply email with the selected verses in the selected translations.

 

Let me know how it works for you.

 

I can look into modifying for work on your machine with a keystroke some time later.


Edited by Graham Buck, 20 October 2018 - 07:45 PM.

  • Fabian likes this

Graham Buck

iOS Programmer
Content Development [Ninja]
OakTree Software





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users