以下のスクリプトを実行する前に、処理対象のActa Classic書類を開いている必要があります。スクリプトはコンパイル済みスクリプト形式で保存して、OSA Menuから実行すると便利だと思います。日本語化の仕方などはここを見てください。
スクリプトの実行前に同階層に (下に) トピックを作成したいトピックを選択しておきます。以下のスクリプトは、作成したトピックに(1), (2), ...というように「(番号) 」という名前を付けます。こういうのは、EGBridgeの連番入力機能なんかを使ってもできますね。
display dialog "1からnまでの兄弟トピックを作ります。nは何ですか?" default answer "3"
set n to (text returned of result) as number -- as integer でもいい
tell application "ActaClassic日本語版"
repeat with aNum from 1 to n
set aName to "(" & aNum & ") "
CreateTopic aName Position sister
end repeat
end tell
少し改造して、繰り返す文字列を一般化するのもいいかな (ここでは%含む文字列で%を数字に置換するようにした)。ダイアログボックスで、繰り返すパターン文字列を入力するようにしたけど、システムソフト電子辞典のところにも書いたように、クリップボードの内容を使ったり、テキストエディタによっては選択範囲の文字列の取得もできるから (繰り返す文字列には改行が含まれていてもいい)、目的とか好みに応じてもっと役立つものが作れるでしょう。
display dialog "1からnまでの兄弟トピックを作ります。nは何ですか?" default answer "3"
set n to text returned of result
display dialog "繰り返すパターン文字列を入力してください (%が数字になる)" default answer "1.%. ステップ%"
set formText to text returned of result
tell application "ActaClassic日本語版"
repeat with aNum from 1 to n
set numStr to aNum as string
set replText to gStr2Str(formText, "%", numStr) of me
CreateTopic replText Position sister
end repeat
end tell
on gStr2Str(theText, origStr, replStr) -- theText内のorigStrをreplStrに置換
set origDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to origStr
set theList to every text item of theText
set AppleScript's text item delimiters to replStr
set theResult to theList as string
set AppleScript's text item delimiters to origDelim
return theResult
end gStr2Str
テキストファイルのファイル名をトピック名として、その下の階層に (中に) テキストファイルの内容を取り込みます。
tell application "Finder"
set isFirst to 1 -- true
repeat with aFile in (every file of selection whose file type is "TEXT")
set aName to name of aFile
open for access file aFile
set aData to read file aFile
close access file aFile
if isFirst is 1 then
tell application "ActaClassic日本語版"
CreateTopic aName Position sister
CreateTopic aData Position daughter
end tell
set isFirst to 0 -- false
else
tell application "ActaClassic日本語版"
CreateTopic aName Position aunt
CreateTopic aData Position daughter
end tell
end if
end repeat
end tell
もちろんBibTeXを利用する場合は、このようにして作成したトピックを選択・コピーし、テキストファイル (.bib) にペーストしたり、ファイル全体をテキストファイル化して使います。詳しくはTeXの本や文系のマカーにも「使える」LaTeXなどのWebページを見て、スクリプトを好みに合わせて変更するといいでしょう (urlとかisbnとか適当に項目を追加したものを示しましたが、代わりにdoi (デジタルオブジェクト識別子, Digital Object Identifier) とかにした方がいいのかも?)。BibTeX専用のアプリケーションとしては、ほとんど使ったことがありませんが、Mac OS 7-9の場合、BiBTeXCardManagerやBibGeneなどのフリーウェアもありますね。(Mac OS 8.6-)Mac OS XではHyperBibDBというフリーウェアがあります。
tell application "ActaClassic日本語版"
CreateTopic "@book{biblabel,"
CreateTopic "author = {}," Position daughter
-- {}でなく""がよければ、{}のところを\"\"とすればいいです。
CreateTopic "editor = {}," Position sister
CreateTopic "title = {}," Position sister
CreateTopic "publisher = {}," Position sister
CreateTopic "isbn = {}," Position sister
CreateTopic "volume = {}," Position sister
CreateTopic "number = {}," Position sister
CreateTopic "series = {}," Position sister
CreateTopic "address = {}," Position sister
CreateTopic "edition = {}," Position sister
CreateTopic "month = {}," Position sister
CreateTopic "year = {}," Position sister
CreateTopic "note = {}," Position sister
CreateTopic "keyword = {}," Position sister
CreateTopic "url = {}," & return & "}" Position sister
-- 上のようにする代わりに以下のようにすると、一つのトピックの中に押し込めます
-- CreateTopic "@book{biblabel,"
-- CreateTopic "author = {}," & return & ¬
-- tab & "editor = {}," & return & ¬
-- tab & "title = {}," & return & ¬
-- tab & "publisher = {}," & return & ¬
-- tab & "isbn = {}," & return & ¬
-- tab & "volume = {}," & return & ¬
-- tab & "number = {}," & return & ¬
-- tab & "series = {}," & return & ¬
-- tab & "address = {}," & return & ¬
-- tab & "edition = {}," & return & ¬
-- tab & "month = {}," & return & ¬
-- tab & "year = {}," & return & ¬
-- tab & "note = {}," & return & ¬
-- tab & "keyword = {}," & return & ¬
-- tab & "url = {}," & return & "}" Position daughter
end tell