https://github.com/andrewpetrochenkov/applescript.py
:apple: :snake: run applescript
https://github.com/andrewpetrochenkov/applescript.py
applescript macos python
Last synced: 3 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 7 years ago)
- Default Branch: master
- Last Pushed: 2021-02-09T12:19:58.000Z (over 4 years ago)
- Last Synced: 2024-06-16T00:25:17.695Z (about 1 year 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://pypi.org/project/applescript/)
[](https://unlicense.org/)
[](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)
```