Need to generate a PS or AI file of any verse of Bible

I am not sure where to even begin on this project

I do a lot of volunteer work with my church and am intereseted in developing an interface, script, app, or whatever that can allow me to

generate Slides whether in Adobe Photoshop or Ill that will contain a bible verse

i figure since the bible is just a database that something like this should be easy enuf to accomplish

basically i need to take the Reference and make it in one format
and the verse itself in another format

John 3:16
For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

I started to generate an xml file that can be imported into AI as “variables” but realized i cant easily use AS to generate my xml because of the issues with trying to code it in

set theHeader to "<?xml version="1.0" encoding="utf-8"?>¬
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN"    "" [¬
	<!ENTITY ns_graphs "">¬
	<!ENTITY ns_vars "">
	<!ENTITY ns_imrep "">
	<!ENTITY ns_custom "">
	<!ENTITY ns_flows "">
<!ENTITY ns_extend "">
<variableSets  xmlns="&ns_vars;">
	<variableSet  varSetName="binding1" locked="none">
			<variable  varName="Description" trait="textcontent" category="&ns_flows;"></variable>
			<variable  varName="Title" trait="textcontent" category="&ns_flows;"></variable>
		<v:sampleDataSets  xmlns="&ns_custom;" xmlns:v="&ns_vars;">"

i obviosly will have problems with the quotes and what have you

is there an easier way to generate the quotes with out having to escape them all?

I am sorry if this seems to ramble and i hope someone understands what i am trying to do

quite simply i need the ability to generate a PS or AI file of any verse of the bible

Yeah, I must say I don’t fully understand what you’re trying to accomplish. However, I have been working with Quicktime on opening pictures with displayed text. I think your trying to match 'a picture with text to display" because you say

But I don’t know if you mean the Pic will have the verse IN THE PICTURE or if you want the text to display in a window with the Pic as it opens. I think you want the text to display in a window with the Pic as it opens. If that is the case, no problem. Tell me what I would see as the viewer. ie, the pic pops up on the screen to a specific point, the verse pops up centered under it, click OK and the pic and text close. Or, select a batch of photos, the first pic opens with its text, I click OK and the next pic opens with its text until the batch is complete.

i am sorry i was i bit crazed when writting my post

quite simply i am trying to create some automated work flow to assist in post-production video I work with the media dept of my church and while we are shooting the video of the message being preached there are bible references that we need to prodcue on frames that will be inserted in post-production

so what i really need is a way to plug in a reference ie “John 3:16” and have the script generate in photoshop or Ill or whatever the actual text of that verse from a Database (the bible)

it would be great if i had a database of the whole bible already but i suppose it would not be to difficult to generate one from many of the online sources or bible software that is available.

I hope that i have made my task a lil more clear now

Opening a new image in Photoshop with size (720 x480 for your project?) and background color should be possible. Pasting text from a text file into the document with font and size sounds reasonable. How will you approach the database part?
If you have a program that searches bible text by verse, hopefully you could get the prog to save the verse to text file. Then the text could be copied to the frame. Do you have such a program? I think you can find a freeware app online. Or, you could use this:

set UserInterface to display dialog "Enter Bible Verse in the format 'genesis 1:01'" default answer ""
set Verse to text returned of UserInterface
open location "" & Verse & "&version1=31"

Run this script, and it will ask a bible verse. The verse will open a html page containing your verse. Since most browsers are scriptable, you could parse the text of the source file containing your verse. It would definitely be preferable to have a prog that would simply return a text file only containing your verse.
Let me know if this helps you with a strategy, and we’ll continue.

that is a great start

i do not have any bible software on my mac
i have something on my pc
maybe i will have to parse a database from the software on my pc

could be a time intensive thing
but then i will have it done and can use it for other things as well

unless someone already has it done that may be what i need to do

but thx again for the start on that

Hi Joe -
If you don’t mind doing a book-to-number translation first (or you can type the list of books into an AppleScript list and figure out the offset into the list based on the book name the user types) this should at least supply you with the text:

display dialog "Please type book number (e.g., Genesis is 1, Revelations is 66):" default answer "58" -- Hebrews is the 58th book
set book to text returned of result

display dialog "Please type chapter number:" default answer "12"
set chapter to text returned of result

display dialog "Please type verse:" default answer "2"
set verse to text returned of result

repeat while length of book < 2
	set book to "0" & book
end repeat

repeat while length of chapter < 3
	set chapter to "0" & chapter
end repeat

set {saveDelims, text item delimiters} to {text item delimiters, ASCII character (13)}
set cmd to "curl "" & book & "C" & chapter & ".htm""
set txt to do shell script cmd
set ofst to offset of ">" & verse & "<" in txt
set txt to text (ofst + 19) through -1 of txt
set ofst to offset of "<" in txt
set verse to text 1 through (ofst - 1) of txt
set lst to text items of verse
set text item delimiters to " "
set verse to lst as text
set verse to do shell script "echo '" & verse & "'|tr -s ' '"
set text item delimiters to saveDelims
display dialog verse

Hope that helps.

  • Dan

Oops, I noticed that sitcom has already provided you with a link. Well, now you have 2!

i am unable to get either to work correctly on my machine

osx 10.3.8
script editor 2.0

dan’s script makes SE crash
and sitcoms returns nothing

Do you think it would be worth while to generate a db in order to use this script offline?

may take a while but might be worth attmepting
also i could do multiple versions ie KJV, NIV, amplified, etc

a bit ambitious but possible and the link that sitcom gave provides different versions

I don’t want to get your hopes too up with that subject line, but

I have played with text to video frame a lot. I use the “goal is the method” approach. I used to make text to video frame displays in OS 9 on the app BTV Pro 5.4.1. All I had to do was type text into a Simple Text document, and drop it on the BTV Pro 5.4.1 Icon, and The text would come up as “titles” in a frame. You can also break text up into phrases, drop the files, and then assemble them as a movie. The effect is basic, white letters on black background. It still produces the desired effect (goal is the method) and you can produce some nice looking black and white titles. Just save the movie as mov and set the custom size to 720 x 480, which is DV standard for NTSC. This can be imported to any Mac video editor, or you can export frames as jpg and use them individually. I can’t get this to work on any OS X software, QT, BTV, so go to classic mode and try it if you wish. Use BTV Pro for os 9, not the carbonized version for 9/ X.


thanks sitcom

i think i am overthinking my intentions

the whole idea of automating this process is this

we usually will have 10-15 scriptures that will be on indivudual frames that will be inserted throughout the video all of which will be on the same backdrop (currently a photoshop file) that once the scripture is referenced we would insert a slide to show that verse.

i am simply looking to NOT have to go in and cut and paste each reference into photoshop

so i would have a list of scripture references that i would need individual slides for

i would like to say something like this
set theScriptures to {“john 3:16”, “mark 1:1”, “malachi 3:10”}
on make_Slide (theScriptures)
repeat with every item in theScriptures
insert scripture address in one text box --(the reference ie John 3:16)
insert the verse in another text box --( the actual verse ie “for god so loved…”)
The name says it all. It is a free OS X native application that searches, returns the verse in whatever form, so here is your database. I could not get it to run on my system, but browsing through the folders I found folder KVJ. Inside that folder was every book of the bible in .txt format!!! And every book is built as if it were a database usable by applescript.

So there is your database. The url above is for the King James v.
That is for other translations not so “Shakespearian”.
I know that older versions of Photoshop were not scriptable without a plugin called Photomatic. Photomatic recorded your actions into a script. If anyone knows where to find any version of that plugin let me know! So you have to find out if

  1. the Photoshop version you have is scriptable or
  2. if you have a scriptable program that inserts text over an image file.
    I don’t know if there are custom commands like you wrote “insert theVerse into”
    that would be neet to find out. Your probably going to end up with something like

display dialog "The verse, please..."
set theVerse to text returned
-- insert code here that would get the text matching the verse
tell application "Photoshop your version"
   set  AlterFrame to open for access file RawFrame with write permission  -- Opens the .jpg or whatever format file that is your template with permission to alter it
--insert code here  that tells the position and font of theVerse to write to ? Man, that could get rough.
close access Alterframe saving with theVerse
end tell

That in no way is supposed to be a script, just one possible pathway to work out. Anyone with tips, please, we’ve ground the stone down quite a bit.

Here is the code for Photoshop to replace the text:

set layerText to (display dialog "Enter some text: " default answer "" buttons {"Cancel", "Ok"} default button 2)
set someText to text returned of layerText

tell application "Adobe Photoshop CS"
   -- Create a new document and art layer.
   set docRef to make new document with properties {width:3 as inches, height:2 as inches}
   set artLayerRef to make new art layer in docRef
   -- Set the art layer's name.  This is not necessary
   -- but makes the layer more identifiable.
   set name of artLayerRef to "MyNewTextLayer"
   -- Tell the art layer that is a text layer.
   set kind of artLayerRef to text layer
   -- Get a reference to the text item and set its contents.
   set textItemRef to text object of artLayerRef
   set contents of contents of textItemRef to someText
end tell

Brandon Carpenter, Tx offered this bit. The scripting plug-in for photoshop 7 is at

I won’t be able to do much more until you let me know how this fares, if your still interested, etc.
SC :slight_smile:

you realy went for it

thanks so much for the time you have put into it

i havn’t had time to get back to that project but will check on it tonight