Skip to main content
Tweeted twitter.com/askdifferent/status/855178214695727105
block code formatting
Source Link
grg
  • 205.5k
  • 45
  • 364
  • 495

I logged the AppleEvents that get sent from a Terminal window. The event that the osascript command sends to the AppleScript compiler/interpreter wasn't logged. How come?

In greater detail, the following argument consists of three hypotheses followed by their logical conclusion. However, experiment shows that the conclusion is false. Hence the argument is faulty. Unfortunately, I don't know why it is faulty. Where does it break?

Hypotheses

  1. macOS comes with a built-in AppleScript compiler/interpreter that is installed as an OSA component.

  2. The Terminal command osascript does not "know" AppleScript. When passed a line of AppleScript code, it passes it on to the AppleScript compiler/interpreter via the OSA architecture by sending out an AppleEvent.

  3. The following line of code, when run in the Terminal, will cause all AppleEvents sent by commands that are executed from the same Terminal window afterwards to be printed out in the Terminal:

     export AEDebugSends=1
    

> export AEDebugSends=1

Conclusion

After running the following two commands in a Terminal window:

> export AEDebugSends=1
> osascript -e 'tell application "Finder" to activate'

export AEDebugSends=1
osascript -e 'tell application "Finder" to activate'

two AppleEvents should be printed out:

  1. One directed from osascript to the AppleScript compiler/interpreter to compile and run the command 'tell application "Finder" to activate'.
  2. One directed from the AppleScript compiler/interpreter to Finder to activate itself.

Actual output

Only one AppleEvent gets printed out, the one sent to Finder:

AE2000 (4085 ): Sending an event:
------oo start of event oo------
aevt('misc''actv' transactionID=0 sourcePSN=[0x0,e00e "Finder"] timeout=7200 eventSource=3 { &'subj':null(), &'csig':magn(65536) })
------oo end of event oo------

I logged the AppleEvents that get sent from a Terminal window. The event that the osascript command sends to the AppleScript compiler/interpreter wasn't logged. How come?

In greater detail, the following argument consists of three hypotheses followed by their logical conclusion. However, experiment shows that the conclusion is false. Hence the argument is faulty. Unfortunately, I don't know why it is faulty. Where does it break?

Hypotheses

  1. macOS comes with a built-in AppleScript compiler/interpreter that is installed as an OSA component.

  2. The Terminal command osascript does not "know" AppleScript. When passed a line of AppleScript code, it passes it on to the AppleScript compiler/interpreter via the OSA architecture by sending out an AppleEvent.

  3. The following line of code, when run in the Terminal, will cause all AppleEvents sent by commands that are executed from the same Terminal window afterwards to be printed out in the Terminal:

> export AEDebugSends=1

Conclusion

After running the following two commands in a Terminal window:

> export AEDebugSends=1
> osascript -e 'tell application "Finder" to activate'

two AppleEvents should be printed out:

  1. One directed from osascript to the AppleScript compiler/interpreter to compile and run the command 'tell application "Finder" to activate'.
  2. One directed from the AppleScript compiler/interpreter to Finder to activate itself.

Actual output

Only one AppleEvent gets printed out, the one sent to Finder:

AE2000 (4085 ): Sending an event:
------oo start of event oo------
aevt('misc''actv' transactionID=0 sourcePSN=[0x0,e00e "Finder"] timeout=7200 eventSource=3 { &'subj':null(), &'csig':magn(65536) })
------oo end of event oo------

I logged the AppleEvents that get sent from a Terminal window. The event that the osascript command sends to the AppleScript compiler/interpreter wasn't logged. How come?

In greater detail, the following argument consists of three hypotheses followed by their logical conclusion. However, experiment shows that the conclusion is false. Hence the argument is faulty. Unfortunately, I don't know why it is faulty. Where does it break?

Hypotheses

  1. macOS comes with a built-in AppleScript compiler/interpreter that is installed as an OSA component.

  2. The Terminal command osascript does not "know" AppleScript. When passed a line of AppleScript code, it passes it on to the AppleScript compiler/interpreter via the OSA architecture by sending out an AppleEvent.

  3. The following line of code, when run in the Terminal, will cause all AppleEvents sent by commands that are executed from the same Terminal window afterwards to be printed out in the Terminal:

     export AEDebugSends=1
    

Conclusion

After running the following two commands in a Terminal window:

export AEDebugSends=1
osascript -e 'tell application "Finder" to activate'

two AppleEvents should be printed out:

  1. One directed from osascript to the AppleScript compiler/interpreter to compile and run the command 'tell application "Finder" to activate'.
  2. One directed from the AppleScript compiler/interpreter to Finder to activate itself.

Actual output

Only one AppleEvent gets printed out, the one sent to Finder:

AE2000 (4085 ): Sending an event:
------oo start of event oo------
aevt('misc''actv' transactionID=0 sourcePSN=[0x0,e00e "Finder"] timeout=7200 eventSource=3 { &'subj':null(), &'csig':magn(65536) })
------oo end of event oo------

deleted 1 character in body
Source Link
Evan Aad
  • 935
  • 1
  • 13
  • 29

I trackedlogged the AppleEvents that get sent from a Terminal window and noticed that the. The event that the osascript command sends to the AppleScript compiler/interpreter doesn't getwasn't logged. How come?

In greater detail, the following argument consists of three hypotheses followed by their logical conclusion. However, experiment shows that the conclusion is false. Hence the argument is faulty. Unfortunately, I don't know why it is faulty. Where does it break?

Hypotheses

  1. macOS comes with a built-in AppleScript compiler/interpreter that is installed as an OSA component.

  2. The Terminal command osascript does not "know" AppleScript. When passed a line of AppleScript code, it passes it on to the AppleScript compiler/interpreter via the OSA architecture by sending out an AppleEvent.

  3. The following line of code, when run in the Terminal, will cause all AppleEvents sent by commands that are executed from the same Terminal window afterwards to be printed out in the Terminal:

> export AEDebugSends=1

Conclusion

After running the following two commands in a Terminal window:

> export AEDebugSends=1
> osascript -e 'tell application "Finder" to activate'

two AppleEvents should be printed out:

  1. One directed from osascript to the AppleScript compiler/interpreter to compile and run the command 'tell application "Finder" to activate'.
  2. One directed from the AppleScript compiler/interpreter to Finder to activate itself.

Actual output

Only one AppleEvent gets printed out, the one sent to Finder:

AE2000 (4085 ): Sending an event:
------oo start of event oo------
aevt('misc''actv' transactionID=0 sourcePSN=[0x0,e00e "Finder"] timeout=7200 eventSource=3 { &'subj':null(), &'csig':magn(65536) })
------oo end of event oo------

I tracked the AppleEvents that get sent from a Terminal window and noticed that the event that the osascript command sends to the AppleScript compiler/interpreter doesn't get logged. How come?

In greater detail, the following argument consists of three hypotheses followed by their logical conclusion. However, experiment shows that the conclusion is false. Hence the argument is faulty. Unfortunately, I don't know why it is faulty. Where does it break?

Hypotheses

  1. macOS comes with a built-in AppleScript compiler/interpreter that is installed as an OSA component.

  2. The Terminal command osascript does not "know" AppleScript. When passed a line of AppleScript code, it passes it on to the AppleScript compiler/interpreter via the OSA architecture by sending out an AppleEvent.

  3. The following line of code, when run in the Terminal, will cause all AppleEvents sent by commands that are executed from the same Terminal window afterwards to be printed out in the Terminal:

> export AEDebugSends=1

Conclusion

After running the following two commands in a Terminal window:

> export AEDebugSends=1
> osascript -e 'tell application "Finder" to activate'

two AppleEvents should be printed out:

  1. One directed from osascript to the AppleScript compiler/interpreter to compile and run the command 'tell application "Finder" to activate'.
  2. One directed from the AppleScript compiler/interpreter to Finder to activate itself.

Actual output

Only one AppleEvent gets printed out, the one sent to Finder:

AE2000 (4085 ): Sending an event:
------oo start of event oo------
aevt('misc''actv' transactionID=0 sourcePSN=[0x0,e00e "Finder"] timeout=7200 eventSource=3 { &'subj':null(), &'csig':magn(65536) })
------oo end of event oo------

I logged the AppleEvents that get sent from a Terminal window. The event that the osascript command sends to the AppleScript compiler/interpreter wasn't logged. How come?

In greater detail, the following argument consists of three hypotheses followed by their logical conclusion. However, experiment shows that the conclusion is false. Hence the argument is faulty. Unfortunately, I don't know why it is faulty. Where does it break?

Hypotheses

  1. macOS comes with a built-in AppleScript compiler/interpreter that is installed as an OSA component.

  2. The Terminal command osascript does not "know" AppleScript. When passed a line of AppleScript code, it passes it on to the AppleScript compiler/interpreter via the OSA architecture by sending out an AppleEvent.

  3. The following line of code, when run in the Terminal, will cause all AppleEvents sent by commands that are executed from the same Terminal window afterwards to be printed out in the Terminal:

> export AEDebugSends=1

Conclusion

After running the following two commands in a Terminal window:

> export AEDebugSends=1
> osascript -e 'tell application "Finder" to activate'

two AppleEvents should be printed out:

  1. One directed from osascript to the AppleScript compiler/interpreter to compile and run the command 'tell application "Finder" to activate'.
  2. One directed from the AppleScript compiler/interpreter to Finder to activate itself.

Actual output

Only one AppleEvent gets printed out, the one sent to Finder:

AE2000 (4085 ): Sending an event:
------oo start of event oo------
aevt('misc''actv' transactionID=0 sourcePSN=[0x0,e00e "Finder"] timeout=7200 eventSource=3 { &'subj':null(), &'csig':magn(65536) })
------oo end of event oo------

added 8 characters in body
Source Link
Evan Aad
  • 935
  • 1
  • 13
  • 29

I tracked the AppleEvents that get sent from a Terminal window and noticed that the event that the osascript command sends to the AppleScript compiler/interpreter doesn't get logged. How come?

In greater detail, the following argument consists of three hypotheses followed by their logical conclusion. However, experiment shows that the conclusion is false. Hence the argument is faulty. Unfortunately, I don't know why it is faulty. Where does it break?

Hypotheses

  1. macOS comes with a built-in AppleScript compiler/interpreter that is installed as an OSA component.

  2. The Terminal command osascript does not "know" AppleScript. When passed a line of AppleScript code, it passes it on to the AppleScript compiler/interpreter via the OSA architecture by sending out AppleEventsan AppleEvent.

  3. The following line of code, when run in the Terminal, will cause all AppleEvents sent by commands that are executed from the same Terminal window afterwards to be printed out in the Terminal:

> export AEDebugSends=1

Conclusion

After running the following two commands in a Terminal window:

> export AEDebugSends=1
> osascript -e 'tell application "Finder" to activate'

two AppleEvents should be printed out:

  1. An eventOne directed atfrom osascript to the AppleScript compiler/interpreter to compile and run the command 'tell application "Finder" to activate'.
  2. And eventOne directed from the AppleScript compiler/interpreter to Finder to activate itself.

Actual output

Only one AppleEvent gets printed out, the one sent to Finder:

AE2000 (4085 ): Sending an event:
------oo start of event oo------
aevt('misc''actv' transactionID=0 sourcePSN=[0x0,e00e "Finder"] timeout=7200 eventSource=3 { &'subj':null(), &'csig':magn(65536) })
------oo end of event oo------

I tracked the AppleEvents that get sent from a Terminal window and noticed that the event that the osascript command sends to the AppleScript compiler/interpreter doesn't get logged. How come?

In greater detail, the following argument consists of three hypotheses followed by their logical conclusion. However, experiment shows that the conclusion is false. Hence the argument is faulty. Unfortunately, I don't know why it is faulty. Where does it break?

Hypotheses

  1. macOS comes with a built-in AppleScript compiler/interpreter that is installed as an OSA component.

  2. The Terminal command osascript does not "know" AppleScript. When passed a line of AppleScript code, it passes it on to the AppleScript compiler/interpreter via the OSA architecture by sending out AppleEvents.

  3. The following line of code, when run in the Terminal, will cause all AppleEvents sent from the Terminal afterwards to be printed out in the Terminal:

> export AEDebugSends=1

Conclusion

After running the following two commands in a Terminal window:

> export AEDebugSends=1
> osascript -e 'tell application "Finder" to activate'

two AppleEvents should be printed out:

  1. An event directed at the AppleScript compiler/interpreter to compile and run the command 'tell application "Finder" to activate'.
  2. And event directed from the AppleScript compiler/interpreter to Finder to activate itself.

Actual output

Only one AppleEvent gets printed out, the one sent to Finder:

AE2000 (4085 ): Sending an event:
------oo start of event oo------
aevt('misc''actv' transactionID=0 sourcePSN=[0x0,e00e "Finder"] timeout=7200 eventSource=3 { &'subj':null(), &'csig':magn(65536) })
------oo end of event oo------

I tracked the AppleEvents that get sent from a Terminal window and noticed that the event that the osascript command sends to the AppleScript compiler/interpreter doesn't get logged. How come?

In greater detail, the following argument consists of three hypotheses followed by their logical conclusion. However, experiment shows that the conclusion is false. Hence the argument is faulty. Unfortunately, I don't know why it is faulty. Where does it break?

Hypotheses

  1. macOS comes with a built-in AppleScript compiler/interpreter that is installed as an OSA component.

  2. The Terminal command osascript does not "know" AppleScript. When passed a line of AppleScript code, it passes it on to the AppleScript compiler/interpreter via the OSA architecture by sending out an AppleEvent.

  3. The following line of code, when run in the Terminal, will cause all AppleEvents sent by commands that are executed from the same Terminal window afterwards to be printed out in the Terminal:

> export AEDebugSends=1

Conclusion

After running the following two commands in a Terminal window:

> export AEDebugSends=1
> osascript -e 'tell application "Finder" to activate'

two AppleEvents should be printed out:

  1. One directed from osascript to the AppleScript compiler/interpreter to compile and run the command 'tell application "Finder" to activate'.
  2. One directed from the AppleScript compiler/interpreter to Finder to activate itself.

Actual output

Only one AppleEvent gets printed out, the one sent to Finder:

AE2000 (4085 ): Sending an event:
------oo start of event oo------
aevt('misc''actv' transactionID=0 sourcePSN=[0x0,e00e "Finder"] timeout=7200 eventSource=3 { &'subj':null(), &'csig':magn(65536) })
------oo end of event oo------

added 11 characters in body
Source Link
Evan Aad
  • 935
  • 1
  • 13
  • 29
Loading
Source Link
Evan Aad
  • 935
  • 1
  • 13
  • 29
Loading