Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)
```


readme42.com