AppleScript Environment¶
- class oscopilot.environments.applescript_env.AppleScript[source]¶
Bases:
SubprocessEnvA class representing an AppleScript environment for executing AppleScript code.
This class inherits from SubprocessEnv, which provides a general environment for executing code in subprocesses.
- add_active_line_indicators(code)[source]¶
Adds log commands to indicate the active line of execution in the AppleScript.
- Parameters:
code (str) – The AppleScript code to add active line indicators to.
- Returns:
The modified AppleScript code with active line indicators.
- Return type:
str
- detect_active_line(line)[source]¶
Detects the active line indicator in the output.
- Parameters:
line (str) – A line from the output.
- Returns:
The line number indicated by the active line indicator, or None if not found.
- Return type:
int
- detect_end_of_execution(line)[source]¶
Detects the end of execution marker in the output.
- Parameters:
line (str) – A line from the output.
- Returns:
True if the end of execution marker is found, False otherwise.
- Return type:
bool
- file_extension = 'applescript'¶
- name = 'AppleScript'¶