AppleScriptErrorNum

[AppleScripts]error number -10004

error number -10004

–10004 A privilege violation occurred.
Apple Events特権違反エラー

ただし、処理を中断〜途中終了するようなエラーではありません。

Error_number10004_20130105_02


10.6からこうなったようです。(気がつきませんでしたw)

【AppleScript Release Notes: 10.6 Changes】


Source:【AppleScript Release Notes: 10.6 Changes】

Source:AppleScript Release Notes: 10.6 Changes


  

 

 

tell application "Finder"から呼び出すとエラーになるので

tell current applicationで実行している事がわかります

 

do shell script で処理を実行する場合のセキュリティへ上の配慮ですかね?

 

 

このサンプルの場合なら

以下のようにする事でエラーにりません。

 

 

Error_number10004_20130105_01

 
Finderや他のアプリケーションからsshを呼び出さないようにする事で
エラーになりません。

別にするパターン

Website_image20130105_172138


tell application "Finder"内で
FInderではなく
tell current applicationで実行させる

Website_image20130105_172150
 
 

エラーになりませんね。
  

tell application "Finder"
-------前処理


tell current application
do shell script "touch /tmp/test.txt"
end tell



--------後処理
end tell


 

error number -10004は
処理を中断〜途中終了するようなエラーではありません。
try
on error
の中で発生しても、処理は継続されます。

Website_image20130105_173409

tell application "Finder"
-------前処理


try
do shell script "touch /tmp/test.txt"
on error theErrorMsg number theErrorNum
activate
display alert (theErrorMsg & "" & theErrorNum) as informational
end try



--------後処理
end tell

|

[AppleScript]Error制御を考える

with timeout of XX seconds
end timeout

try
on error
end try

repeat
exit repeat
end repeat

が中心かなぁ


tell application "Finder"
activate
with timeout of 60 seconds
repeat
try


display dialog "入力" default answer ¬
"入力支援" buttons {"タイプ1", "タイプ2", "キャンセル"} ¬
with icon caution ¬
with title ¬
"タイトル" cancel button ¬
"キャンセル" default button ¬
"タイプ2" giving up after 10 without hidden answer

if button returned of the result is "タイプ1" then
set MainFileName to text returned of the result as Unicode text
set dialogObj to "タイプ1をおしました"


else if button returned of the result is "タイプ2" then
set MainFileName to text returned of the result as Unicode text
set dialogObj to "タイプ2をおしました"

else if gave up of the result is true then
set dialogObj to "時間切れになりました"
display dialog (dialogObj) with icon 2
exit repeat

end if

on error errText number errNum
display dialog (errText) & "\nerror number:" & (errNum) with icon 2
exit repeat
end try
end repeat
end timeout
end tell


 

「error.html」をダウンロード[LINK]新しいウィンドで開きます

「error.scpt.zip」をダウンロード[Download]新しいウィンドで開きます


 

| | コメント (0)

AppleScript Error Numbers List【-2708〜-2763】

全て見るにはこちから
[FORCE]: AppleScript Error Code 一覧[LINK]新しいウィンドで開きます

アップルのリファレンスはこちら
AppleScript Language Guide[LINK]AppleScript Language Guideを新しいウィンドで開きます

 

Error numberError message
–2708Attempt to create a value larger than the allowable size.
–2709Can’t get the event dictionary.
–2720Can’t both consider and ignore <attribute>.
–2721Can’t perform operation on text longer than 32K bytes.
–2729Message size too large for the 7.0 Finder.
–2740A <language element> can’t go after this <language element>.
–2741Expected <language element> but found <language element>.
–2750The <name> parameter is specified more than once.
–2751The <name> property is specified more than once.
–2752The <name> handler is specified more than once.
–2753The variable <name> is not defined.
–2754Can’t declare <name> as both a local and global variable.
–2755Exit statement was not in a repeat loop.
–2760Tell statements are nested too deeply.
–2761<name> is illegal as a formal parameter.
–2762<name> is not a parameter name for the event <event>.
–2763No result was returned for some argument of this expression.


| | コメント (0)

AppleScript Application Error Numbers List【-2700〜-2706】

全て見るにはこちから
[FORCE]: AppleScriptError Numbers[LINK][FORCE]: AppleScriptError Numbersを新しいウィンドで開きます
アップルのリファレンスはこちら
AppleScript Language Guide[LINK]AppleScript Language Guideを新しいウィンドで開きます

 

Error numberError message
-2700Unknown error.
–2701Can’t divide <number> by zero.
–2702The result of a numeric operation was too large.
–2703<reference> can’t be launched because it is not an application.
–2704<reference> isn’t scriptable.
–2705The application has a corrupted dictionary.
–2706Stack overflow.
–2707Internal table overflow.

| | コメント (0)

AppleScript Application Error Numbers List【-10002〜-10015】

全て見るにはこちから
[FORCE]: AppleScript Error Code 一覧[LINK]新しいウィンドで開きます

アップルのリファレンスはこちら
AppleScript Language Guide[LINK]AppleScript Language Guideを新しいウィンドで開きます

 

Error numberError message
–10002Invalid key form.
–10003Can't set <object or data> to <object or data>. Access not allowed.
–10004A privilege violation occurred.
–10005The read operation wasn't allowed.
–10006Can't set <object or data> to <object or data>.
–10007The index of the event is too large to be valid.
–10008The specified object is a property, not an element.
–10009Can’t supply the requested descriptor type for the data.
–10010The Apple event handler can’t handle objects of this class.
–10011Couldn’t handle this command because it wasn’t part of the current transaction.
–10012The transaction to which this command belonged isn’t a valid transaction.
–10013There is no user selection.
–10014Handler only handles single objects.
–10015Can’t undo the previous Apple event or user action.


| | コメント (0)

AppleScript object Error Numbers List【-1728〜-1760】

全て見るにはこちから
[FORCE]: AppleScriptError Numbers[LINK][FORCE]: AppleScriptError Numbersを新しいウィンドで開きます
アップルのリファレンスはこちら
AppleScript Language Guide[LINK]AppleScript Language Guideを新しいウィンドで開きます

 

Error numberError message
–1728Can’t get <reference>.
–1729Object counting procedure returned a negative count.
–1730Container specified was an empty list.
–1731Unknown object type.
–1750Scripting component error.
–1751Invalid script id.
–1752Script doesn’t seem to belong to AppleScript.
–1753Script error.
–1754Invalid selector given.
–1755Invalid access.
–1756Source not available.
–1757No such dialect.
–1758Data couldn’t be read because its format is obsolete.
–1759Data couldn’t be read because its format is too new.
–1760Recording is already on.

| | コメント (0)

AppleScript object Error Numbers List【-1700〜-1727】


全て見るにはこちから
[FORCE]: AppleScript Error Code 一覧[LINK]新しいウィンドで開きます

アップルのリファレンスはこちら
AppleScript Language Guide[LINK]AppleScript Language Guideを新しいウィンドで開きます

 


Error numberError message
–1700Can’t make some data into the expected type.
–1701Some parameter is missing for <commandName>.
–1702Some data could not be read.
–1703Some data was the wrong type.
–1704Some parameter was invalid.
–1705Operation involving a list item failed.
–1706Need a newer version of the Apple Event Manager.
–1707Event isn’t an Apple event.
–1708<reference> doesn’t understand the <commandName> message.
–1709AEResetTimer was passed an invalid reply.
–1710Invalid sending mode was passed.
–1711User canceled out of wait loop for reply or receipt.
–1712Apple event timed out.
–1713No user interaction allowed.
–1714Wrong keyword for a special function.
–1715Some parameter wasn’t understood.
–1716Unknown Apple event address type.
–1717The handler <identifier> is not defined.
–1718Reply has not yet arrived.
–1719Can’t get <reference>. Invalid index.
–1720Invalid range.
–1721<expression> doesn’t match the parameters <parameterNames> for<commandName>.
–1723Can’t get <expression>. Access not allowed.
–1725Illegal logical operator called.
–1726Illegal comparison or logical.
–1727Expected a reference.


| | コメント (0)

AppleScript Operating System Error Numbers List【-35〜-915】

全て見るにはこちから
[FORCE]: AppleScriptError Numbers[LINK][FORCE]: AppleScriptError Numbersを新しいウィンドで開きます
アップルのリファレンスはこちら
AppleScript Language Guide[LINK]AppleScript Language Guideを新しいウィンドで開きます

 

Error numberError message
0No error.
-34Disk <name> full.
-35Disk <name> wasn’t found.
-37Bad name for file
-38File <name> wasn’t open.
-39End of file error.
-42Too many files open.
-43File <name> wasn’t found.
-44Disk <name> is write protected.
-45File <name> is locked.
-46Disk <name> is locked.
-47File <name> is busy.
-48Duplicate file name.
-49File <name> is already open.
-50Parameter error.
-51File reference number error.
-61File not open with write permission.
-108Out of memory.
-120Folder <name> wasn’t found.
-124Disk <name> is disconnected.
-128User cancelled.
-192A resource wasn’t found.
-600Application isn’t running
-601Not enough room to launch application with special requirements.
-602Application is not 32-bit clean.
-605More memory needed than is specified in the size resource.
-606Application is background-only.
-607Buffer is too small.
-608No outstanding high-level event.
-609Connection is invalid.
-904Not enough system memory to connect to remote application.
-905Remote access is not allowed.
-906<name> isn’t running or program linking isn’t enabled.
-915Can’t find remote machine.
-30720Invalid date and time .


| | コメント (0)

AppleScript Error Numbers List【-2700〜-2763】

全て見るにはこちから
[FORCE]: AppleScript Error Code 一覧[LINK]新しいウィンドで開きます

アップルのリファレンスはこちら
AppleScript Language Guide[LINK]AppleScript Language Guideを新しいウィンドで開きます

 

Error numberError message
-2700Unknown error.
-2701Can’t divide by zero.
-2702The result of a numeric operation was too large.
-2703 can't be launched because it is not an application.
-2704 isn't scriptable.
-2705The application has a corrupted dictionary.
-2706Stack overflow.
-2707Internal table overflow.
-2708Attempt to create a value larger than the allowable size.
-2709Can't get the event dictionary.
-2720Can't both consider and ignore .
-2721Can't perform operation on text longer than 32K bytes.
-2729Message size too large for the 7.0 Finder.
-2740A can't go after this .
-2741Expected but found .
-2750The parameter is specified more than once.
-2751The property is specified more than once.
-2752The handler is specified more than once.
-2753The variable is not defined.
-2754Can't declare as both a local and global variable.
-2755Exit statement was not in a repeat loop.
-2760Tell statements are nested too deeply.
-2761 is illegal as a formal parameter.
-2762 is not a parameter name for the event .
-2763No result was returned for some argument of this expression.


| | コメント (0)

その他のカテゴリー

Accessibility AccessibilityCheck AccessibilityForm AccessibilityInDesign AccessibilityPDF Acrobat Acrobat Action Acrobat Annotation Acrobat AppleScripts Acrobat Character Acrobat Layer Acrobat PDF Embed API Acrobat PDF Form Print Acrobat Plug-ins Acrobat Portfolios Acrobat Print AcrobatBarcode AcrobatDialog AcrobatForm AcrobatJS AcrobatMenu AcrobatPDF AcrobatStamp AcrobatYouTube AddressBook Adobe Adobe InDesign Adobe Photoshop AdobeAppleScript AdobeBridge AdobeIllustrator AdobeJSX aed Alfresco Android AnimationGif Apple Apple Support AppleScript AppleScriptBasics AppleScriptCharacter AppleScriptColor AppleScriptDroplet AppleScriptErrorNum AppleScriptFolder AppleScriptFontBook AppleScriptRename AppleScriptTools AppleSymbols Applications Barcode Barcode2D BarcodePostal BetterHTMLExport Book BOX Browser buzz Certificates CharacterEntity CharacterSets Colors Cool Site CSS Cutting DecoMail DecorationMail Design Desktop Diff DJ dmg DNS Documents Download DTP eBook Editer eMail Envelopes ExifTool Facebook FFmpeg File System Fonts FontsTool FontsWeb FOOD FormPrint ftp Gadget Gif Animation Google Google Chrome Enterprise HexEditor HTML info iPhoto ISBN ISO iTunes iWork iWorkNumbers iWorkNumbersCalendar iWorkNumbersTimecard iWorkPages JavaScript JeditX JeditX Regexp JeditXAppleScript JIS jquery Letterpress Library logo Mac Admin Mac Archiver Mac Browser Mac Browser Plugin Mac QuickLook Mac Setup Mac Spotlight Mac Video Map Memo Microsoft Teams Mobby mobileconfig Moto Movies Music Network Basic ntp OCR Office OfficePowerPoint OSX Paint Pantone Paper PDFlib Permission Photo Pictograms Print Public Python QuickLook QuickTime QuickTimeSetting QuickTimeSound Real Media ReName ResourceFork ruby Sample Screen ScreenCast Search Security SEO Sharing SLAResource Sound Spotlight Stamp SWF TCC.db Tutorial PSD TV Twitter Typography Unicode Utilities Video WEB APP WebFont Wedding Windows WindowsMedia XML XMP XPS YouTube YouTube Rss