set ocidPageNameArray to refMe's NSMutableArray's arrayWithArray:(ocidAllKeys)
set ocidDescriptor to refMe's NSSortDescriptor's sortDescriptorWithKey:("self") ascending:(yes) selector:("localizedStandardCompare:")
set ocidDescriptorArray to refMe's NSArray's arrayWithObject:(ocidDescriptor)
set ocidPaperNameArray to ocidPageNameArray's sortedArrayUsingDescriptors:(ocidDescriptorArray)
set listPaperSizeName to ocidPaperNameArray as list
###ダイアログ
set strName to (name of current application) as text
if strName is "osascript"then
tell application "Finder" to activate
else
tell current application to activate
end if
try
set listResponse to (choose from list listPaperSizeName with title "選んでください"with prompt "用紙を選んでください" default items (item 1of listPaperSizeName) OK button name "OK" cancel button name "キャンセル"without multiple selections allowed and empty selection allowed) as list
on error
log "エラーしました"
return "エラーしました"
end try
if (item 1of listResponse) is falsethen
return "キャンセルしました"
end if
set strResponse to (item 1of listResponse) as text
#####
set listPaperSizePt to ocidPageSizePtDict's valueForKey:(strResponse)
log listPaperSizePt as list
set intWidthPt to (item 1of listPaperSizePt) as number
set intHeightPt to (item 2of listPaperSizePt) as number
#
# set numVar to 25.4 as number
# set numWidthMM to ((intWidthPt / 72) * numVar) as number
# set numHeightMM to ((intHeightPt / 72) * numVar) as number
##
#####キーノートで新規書類を作成する
tell application "Keynote"
activate
set objNewDocument to (make new document with properties {name:"" & strResponse & "", height:"" & intHeightPt & "", width:"" & intWidthPt & "", slide numbers showing:true, document theme:theme id "Application/21_BasicWhite/Standard"})
set ocidPageNameArray to refMe's NSMutableArray's arrayWithArray:(ocidAllKeys)
set ocidDescriptor to refMe's NSSortDescriptor's sortDescriptorWithKey:("self") ascending:(yes) selector:("localizedStandardCompare:")
set ocidDescriptorArray to refMe's NSArray's arrayWithObject:(ocidDescriptor)
set ocidPaperNameArray to ocidPageNameArray's sortedArrayUsingDescriptors:(ocidDescriptorArray)
set listPaperSizeName to ocidPaperNameArray as list
###ダイアログ
set strName to (name of current application) as text
if strName is "osascript"then
tell application "Finder" to activate
else
tell current application to activate
end if
try
set listResponse to (choose from list listPaperSizeName with title "選んでください"with prompt "用紙を選んでください" default items (item 1of listPaperSizeName) OK button name "OK" cancel button name "キャンセル"without multiple selections allowed and empty selection allowed) as list
on error
log "エラーしました"
return "エラーしました"
end try
if (item 1of listResponse) is falsethen
return "キャンセルしました"
end if
set strResponse to (item 1of listResponse) as text
#####
set listPaperSizePt to ocidPageSizePtDict's valueForKey:(strResponse)
log listPaperSizePt as list
set intWidthPt to (item 2of listPaperSizePt) as number
set intHeightPt to (item 1of listPaperSizePt) as number
#
# set numVar to 25.4 as number
# set numWidthMM to ((intWidthPt / 72) * numVar) as number
# set numHeightMM to ((intHeightPt / 72) * numVar) as number
##
#####キーノートで新規書類を作成する
tell application "Keynote"
activate
set objNewDocument to (make new document with properties {name:"" & strResponse & "", height:"" & intHeightPt & "", width:"" & intWidthPt & "", slide numbers showing:true, document theme:theme id "Application/21_BasicWhite/Standard"})
setlistResponseto (choose from list listAllKeys with title "選んでください"with prompt "アイコンを選んでください" default items (item8of listAllKeys) OK button name"OK" cancel button name"キャンセル"without multiple selections allowed and empty selection allowed)