Jump to content

dash problems


ChristianB

Recommended Posts

Unfortunately I don't have a slovene bible inside Accordance. So what I do is copy the reference and send it via launchbar to the website of the slovene bible.

 

But somewhere on the way between Accordance, LaunchBar and the website there is an issue with dashes.

The long dash Accordance uses causes trouble. On the website it looks like this. http://cl.ly/3LYv

 

Doesn't happen with a short dash so I wonder if there is an option to get that instead.

Might be related to LaunchBar but still would like to have the option ?

Link to comment
Share on other sites

Hm... what's the site, and did you define the search template in LaunchBar as using UTF-8 (vs. ISO Latin 1)?

Link to comment
Share on other sites

Looks like it's an entity conversion issue (bug?) with the Bible site; so maybe the thing to do is to write a script to search and replace en-dashes with hyphens before passing it to the URL?

Link to comment
Share on other sites

Looks like it's an entity conversion issue (bug?) with the Bible site; so maybe the thing to do is to write a script to search and replace en-dashes with hyphens before passing it to the URL?

Yeah. Will try that if it keeps bugging me?

Link to comment
Share on other sites

Ok, got it.

Thats how it looks like:

 

on handle_string(theString)
-- set theString to "John 14,2–4"

-- Zahlen & Zeilenumbrüche entfernen
set badChars to {"–"} -- and whatever else you want in here

set newString to ""
set iChar to 1
repeat until iChar > (count of theString)
	if badChars contains (item iChar of theString) then
		set newString to newString & "-" as string -- what you'd like to replace it with
	else
		set newString to newString & (item iChar of theString) as string
	end if
	set iChar to iChar + 1
end repeat

set badChars to string id {32} -- and whatever else you want in here

set _newString to ""
set iChar to 1
repeat until iChar > (count of newString)
	if badChars contains (item iChar of newString) then
		set _newString to _newString & "+" as string -- what you'd like to replace it with
	else
		set _newString to _newString & (item iChar of newString) as string
	end if
	set iChar to iChar + 1
end repeat


set _url to "http://www.biblija.net/biblija.cgi?m=" & _newString & "&compact=1&id13=1&pos=0&set=2&l=sl"
open location _url

end handle_string

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...