0

フィードしたExcelファイルでの実行を拒否するAppleScriptがあります。また、開くことを拒否します。AppleScriptEditorでスクリプトを開こうとすると、次のプロンプトが表示されます。

Open Dictionary: Unable to read the dictionary of the application or extension because it is not scriptable.

Mountain LionのAppleScriptと競合するアップデートはありますか?スクリプトが機能するのを妨げている他のエラーは何ですか?

on open excelFiles

set numRows to 0
set numCols to 0
set usedRange to 0

repeat with eachFile in excelFiles
tell application "Microsoft Excel"
set tbook to open workbook workbook file name (eachFile as string)
set tName to name of tbook
set numCols to (count of columns of used range of active sheet)
set numRows to (count of rows of used range of active sheet)

insert into range column 1 of active sheet -- insert column
set lastCell to last cell of used range of active sheet -- get last cell from the used range
set value of range ("A1:A" & first row index of lastCell) of active sheet to tName --set first column's values to the file name

--set lastCell to last cell of used range of active sheet -- get last cell from the used range
--set value of range ("A1:A" & numRows) of active sheet to tName --set first column's values to the file name
--set usedRange to (used range of active sheet)

replace (used range of active sheet) what "," replacement ("^")
replace (used range of active sheet) what "$" replacement (" ")
replace (used range of active sheet) what "°" replacement ("-degrees ")
replace (used range of active sheet) what "©" replacement (" ")
replace (used range of active sheet) what "à" replacement ("a")
replace (used range of active sheet) what "á" replacement ("a")
replace (used range of active sheet) what "â" replacement ("a")
replace (used range of active sheet) what "ã" replacement ("a")
replace (used range of active sheet) what "ä" replacement ("a")
replace (used range of active sheet) what "ç" replacement ("c")
replace (used range of active sheet) what "ć" replacement ("c")
replace (used range of active sheet) what "è" replacement ("e")
replace (used range of active sheet) what "é" replacement ("e")
replace (used range of active sheet) what "ê" replacement ("e")
replace (used range of active sheet) what "ë" replacement ("e")
replace (used range of active sheet) what "ì" replacement ("i")
replace (used range of active sheet) what "í" replacement ("i")
replace (used range of active sheet) what "î" replacement ("i")
replace (used range of active sheet) what "ï" replacement ("i")
replace (used range of active sheet) what "ò" replacement ("o")
replace (used range of active sheet) what "ô" replacement ("o")
replace (used range of active sheet) what "ó" replacement ("o")
replace (used range of active sheet) what "õ" replacement ("o")
replace (used range of active sheet) what "ö" replacement ("o")
replace (used range of active sheet) what "ü" replacement ("u")
replace (used range of active sheet) what "½" replacement (".5")
replace (used range of active sheet) what "¼" replacement (".25")
replace (used range of active sheet) what "¾" replacement (".75")

--display dialog "The used range of this sheet is" & range
--display dialog "The number of rows of this file is " & numRows
--display dialog "The number of collumns of this file is " & numCols

close tbook saving yes

end tell
end repeat
end open
4

1 に答える 1

0

バンドル識別子を教えてみてください。

tell application id "com.microsoft.Excel"
-- insert your code
end tell
于 2012-09-20T13:12:29.990 に答える