メインコンテンツまでスキップ
バージョン:25.2

do

  • command

  • The do command executes some text as a sequence of one or more SenseTalk commands. The text is compiled and executed in the context of the current handler. This means that any variables used in the do text are interpreted as the same variables in the local context.

  • The do AppleScript expression or do expression as AppleScript commands (on Mac OS X systems only) are alternative ways of calling doAppleScript to execute text as AppleScript commands.

  • Examples: +

     // This is a contrived example that could be done more simply without using "do"
    // Add to chocolateCount or vanillaCount based on the flavor variable:
    if flavor is "chocolate" then set varName to "chocolateCount" else set varName to "vanillaCount"
    set addCommand to "add 1 to " & varName — construct the command
    do addCommand — execute the addition
  • Related: value, send, doAppleScript, evaluationContext