Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewpetrochenkov/applescript.py
:apple: :snake: run applescript
https://github.com/andrewpetrochenkov/applescript.py
applescript macos python
Last synced: about 2 months ago
JSON representation
:apple: :snake: run applescript
- Host: GitHub
- URL: https://github.com/andrewpetrochenkov/applescript.py
- Owner: andrewpetrochenkov
- License: unlicense
- Created: 2018-06-26T02:40:11.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-09T12:19:58.000Z (over 3 years ago)
- Last Synced: 2024-06-16T00:25:17.695Z (3 months ago)
- Topics: applescript, macos, python
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 67
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![](https://img.shields.io/pypi/v/applescript.svg?maxAge=3600)](https://pypi.org/project/applescript/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)
[![](https://github.com/andrewp-as-is/applescript.py/workflows/tests42/badge.svg)](https://github.com/andrewp-as-is/applescript.py/actions)### Installation
```bash
$ [sudo] pip install applescript
```#### Examples
```python
>>> import applescript
>>> r = applescript.run('return 1')
>>> r = applescript.run('path/to/file.applescript')>>> r.code
0
>>> r.out
'hello world'
>>> r.err
''
````tell application "appname"`
```python
>>> applescript.tell.app("Terminal",'do script "ls"')
>>> applescript.tell.app("Terminal",'do script "ls"',background=True)
```javascript (JXA)
```python
>>> applescript.run('...',javascript=True)
```