[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(DTPtechNote:645) paste text
ぬるい感じだけど、OSA Menuとかに入れて使うと便利かも
(*
コピーした文字列にスタイルが含まれているとき、文字列だけをペーストします。
2003.12.18 seuzo- ym3s-ickw@asahi-net.or.jp
*)
tell application "QuarkXPress召4.10r2J"
activate
--・ッ・�Д董Ε蕁Ε錙�シ・ノ、ホウホヌァ、ネシ隍��
if (clipboard info for string) is not {} then --クリップボードのテキストが空でなかったら
set clip_str to (the clipboard) as Unicode text --変数にセットしちゃう
else
my my_error("クリップボードが空です", true) --クリップボードが空なら中止
end if
--確認
if (not (exists selection)) or class of selection is not text then
my my_error("カーソルが挿入位置にありません", true) --セル以外を選択しているなら中止
end if
--実行
try
set contents of selection to clip_str
on error errMsg number errNum
my my_error(errMsg & return & errNum, true) --エラーが起こったら中止
end try
end tell
----------------------------------●エラー処理
on my_error(err_str, my_stop)
if my_stop then
set my_stop to {"中止"}
else
set my_stop to {"中止", "続行"}
end if
tell application "QuarkXPress召4.10r2J"
activate
set ans to button returned of (display dialog err_str buttons my_stop with icon stop) --キルケ'タ・、・「・�А璽好漾▲�、ニ・ケ・ネ・テ・ラ
if ans is "テ貊゜" then error number -128
end tell
end my_error