Ordering Groups

I’m very new to DTP, so I assume I’m making a newbie mistake, but for the life of me I can’t figure out how to order (re-order) the groups in the three pane view. I can double-click on the containing group and re-order the sub-groups in the window that pops open, but that order doesn’t seem to show up in the groups area of the three pane view.

I’ve converted all groups and sub-groups to “unsorted”, and done everything else I can think of… Essentially, the sub-groups are the sections of an article I’m writing, and I can’t get them into the order I need them in for the article. I suspect there is a simple thing I’m not doing. Any help would be most appreciated.

ciao

The Horizontal Split (“Outline”) view will let you do that. So will the Vertical Split view. Just open your project group in its own view window and set that view to Vertical or Horizontal Split.

Yep. This is particularly irritating because DTP (like every other app I know) is completely ignorant of a recent invention called Roman numerals. Admittedly, non-techies might find the system is a bit difficult to grasp…

However, if you (or anyone coming across this post) use Roman numerals and want your IX’s showing up between your VIII’s and X’s, an irritating kludge is available via Unicode. The following are Unicode characters that will be sorted correctly in DTP and other apps (though I haven’t tested). Just copy them into a document and use them to name your groups or whatever depends on the system.

Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ Ⅼ Ⅽ Ⅾ Ⅿ
ⅰ ⅱ ⅲ ⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ ⅺ ⅻ ⅼ ⅽ ⅾ ⅿ

Wow, this is useful for old fashioned numbering. It took me a while to figure out that each these roman numerals are extra unicode characters, but they work in DT.
Hm. Kalisphoenix, is there any other way to insert them, other than copy / paste ?

Sorry for the delay, I was in Las Vegas for a job interview. Please, if anyone reads this, please hire me. Please. eyeballs DEVONtechnologies, who could use a… cook, or something, because Lord Knows I can’t program my way out of Bill DeVille’s toupée

Anyway, I feel your pain after using this myself for a few days. Your note was all it took to make me think “hey, I should script that.” And then I grabbed myself some apple cider and started scriptin’. And, as per usual, what seemed to be a simple task turned into a raging pain in the ass, since I am working on Tiger and using its Unicode-crippled AppleScript and not the Unicode-savvy AppleScript of Leopard. This should still work on Leopard, though, and it’s a quick change if it doesn’t.

Select some articles or groups in your database (named “12. Cow” or “XIX. Moo” or whatever) and run this script, and it’ll replace the initial number (everything before the “.”) with proper Roman numerals. “XII” is rendered as X + II, not XII as above, because I didn’t feel like making algorithm exceptions just to use all of the provided Unicode characters :slight_smile: It nicely follows the “order of magnitude” rule in constructing roman numerals – ie, it’ll correctly write 99 as XCIX and not IC and 1999 as MCMXCIX, not MIM. It only goes up to 3999, but if you’re using Roman numerals to count that high, well, that’s just ridiculous.


tell application "DEVONthink Pro"
	set theSelection to the selection
	set theDelimiter to "." -- Change this if you're using a colon or something else to separate the Roman numerals from the rest of the article/group title.
	set AppleScript's text item delimiters to theDelimiter
	repeat with thisSelection in theSelection
		set thisTitle to the name of thisSelection
		set theTitleParts to the text items of thisTitle
		set theNumeralPart to text item 1 of theTitleParts
		try
			if the first character of theNumeralPart is in "MDCLXVI" then set theNumeralPart to my GetArabicOf(theNumeralPart) -- Convert it to Arabic numbers first if it's in Roman numerals already, to make this easier.
			if the first character of theNumeralPart is in "0123456789" then set theNumeralPart to my GetRomanOf(theNumeralPart) -- Convert that Arabic numeral to a Unicode Roman string.		
		end try
		set theNewName to theNumeralPart & theDelimiter & (items 2 through -1 of theTitleParts) as Unicode text
		set the name of thisSelection to theNewName
	end repeat
end tell

on GetRomanOf(theNumber)
	set theRomanThousands to {"", «data utxt216F» as Unicode text, («data utxt216F» as Unicode text) & «data utxt216F» as Unicode text, ((«data utxt216F» as Unicode text) & «data utxt216F» as Unicode text) & «data utxt216F» as Unicode text}
	set theRomanHundreds to {"", «data utxt216D» as Unicode text, («data utxt216D» as Unicode text) & «data utxt216D» as Unicode text, ((«data utxt216D» as Unicode text) & «data utxt216D» as Unicode text) & «data utxt216D» as Unicode text, («data utxt216D» as Unicode text) & «data utxt216E» as Unicode text, «data utxt216E» as Unicode text, («data utxt216E» as Unicode text) & «data utxt216D» as Unicode text, ((«data utxt216E» as Unicode text) & «data utxt216D» as Unicode text) & «data utxt216D» as Unicode text, (((«data utxt216E» as Unicode text) & «data utxt216D» as Unicode text) & «data utxt216D» as Unicode text) & «data utxt216D» as Unicode text, («data utxt216D» as Unicode text) & «data utxt216F» as Unicode text}
	set theRomanTens to {"", «data utxt2169» as Unicode text, («data utxt2169» as Unicode text) & «data utxt2169» as Unicode text, ((«data utxt2169» as Unicode text) & «data utxt2169» as Unicode text) & «data utxt2169» as Unicode text, («data utxt2169» as Unicode text) & «data utxt216C» as Unicode text, «data utxt216C» as Unicode text, («data utxt216C» as Unicode text) & «data utxt2169» as Unicode text, ((«data utxt216C» as Unicode text) & «data utxt2169» as Unicode text) & «data utxt2169» as Unicode text, (((«data utxt216C» as Unicode text) & «data utxt2169» as Unicode text) & «data utxt2169» as Unicode text) & «data utxt2169» as Unicode text, («data utxt2169» as Unicode text) & «data utxt216D» as Unicode text}
	set theRomanOnes to {"", «data utxt2160» as Unicode text, «data utxt2161» as Unicode text, «data utxt2162» as Unicode text, «data utxt2163» as Unicode text, «data utxt2164» as Unicode text, «data utxt2165» as Unicode text, «data utxt2166» as Unicode text, «data utxt2167» as Unicode text, «data utxt2168» as Unicode text}
	set theResult to ""
	repeat with theCounter from 1 to (count (theNumber as string))
		set theResult to item (((item -theCounter of (theNumber as string)) as integer) + 1) of item theCounter of {theRomanOnes, theRomanTens, theRomanHundreds, theRomanThousands} & theResult
	end repeat
end GetRomanOf

on GetArabicOf(theNumber)
	set theResult to 0
	repeat with theCounter from 1 to count theNumber
		set theResult to theResult + (item (offset of (item theCounter of theNumber) in "MDCLXVI") of {1000, 500, 100, 50, 10, 5, 1}) * (((((offset of (item (theCounter + 1) of (theNumber & "@")) in "MDCLXVI@") ≥ (offset of (item theCounter of theNumber) in "MDCLXVI")) as integer) * 2) - 1)
	end repeat
end GetArabicOf

Hope that helps :slight_smile: Note that it’ll take either a roman numeral or a arabic numeral and convert it to the sexxxy Unicode if it’s the first item. Normal strings will be ignored (but suffixed with three delimiters for some reason I don’t feel like troubleshooting) unless they begin with M,D,C,L,X,V or I. So as always, back up before using a KalisphoenixScript and use only on articles that begin with an appropriate arabic or text numeral prefix.

Wow!!! Thank you for the script, kalisphoenix. Actually I was just thinking about a keyboard shortcut or something but apparently there is no simple shortcut for roman numerals, so your script is the most convenient way to convert these arabic numerals into roman empire numerals. Definitely something to try for group names for chapters and subchapters - thank you!

Maybe it’s not what you want - it certainly isn’t simple - but you can try switching to Unicode keyboard.
System Prefs > International > Input menu tab > tick “Unicode Hex Input”.
Input menu appears in upper right if not already there.
Pull down and select “Unicode Hex”.
Then, for example, hold down the option key and type “2167” for VIII. You gotta know the Unicode Hex numbers - Roman numerals are 2159 + N, and any other character can be found from hovering over the character palette (use Edit > Special Characters from just about any app).
All normal characters and commands will work except anything involving the option key. To get back, Input Menu > reset to your default (for example, US or UK keyboard).