https://github.com/hhas/swiftautoedit
Old quick-n-dirty Swift micro-editor for SwiftAutomation users. Very, very abandoned.
https://github.com/hhas/swiftautoedit
applescript automation swift
Last synced: over 1 year ago
JSON representation
Old quick-n-dirty Swift micro-editor for SwiftAutomation users. Very, very abandoned.
- Host: GitHub
- URL: https://github.com/hhas/swiftautoedit
- Owner: hhas
- Created: 2020-06-30T19:58:33.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-30T19:58:45.000Z (about 6 years ago)
- Last Synced: 2023-10-16T23:10:29.812Z (over 2 years ago)
- Topics: applescript, automation, swift
- Language: Swift
- Homepage:
- Size: 50.8 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
# SwiftAutoEdit README
SwiftAutoEdit is a quick-n-dirty Swift micro-editor that enables
SwiftAutomation users to write and run simple Swift-based "scripts".
## Features
* syntax highlighting
* application dictionary (SDEF file) viewer
* AppleScript to Swift command translator
## Requirements
* SourceKitten (https://github.com/jpsim/SourceKitten)
* SwiftAutomation (https://bitbucket.org/hhas/swiftae)
For detailed installation instructions, see the above projects' own
documentation. Precis:
To install SourceKitten:
git clone https://github.com/jpsim/SourceKitten.git
cd SourceKitten
sudo make install
To install SwiftAutomation:
git clone https://bitbucket.org/hhas/swiftae.git
Build the SwiftAutomation and MacOSGlues frameworks using the
project's Release scheme, then create symlinks to the built frameworks
in /Library/Frameworks (replace `/PATH/TO` with the path to the actual
build folder):
cd /Library/Frameworks
sudo ln -s /PATH/TO/Build/Products/Release/SwiftAutomation.framework
sudo ln -s /PATH/TO/Build/Products/Release/MacOSGlues.framework
## Caveats
This code is a quick-n-filthy hack, therefore, use at own risk, E&OE,
no warranties given.
Also:
* The dictionary viewer relies on non-public OSAKit APIs. There isn't
yet an option to display a dictionary by selecting its application
directly; for now, use File>Open to select an `.sdef` file already
created by SwiftAutomation's `aeglue` tool. (Tip: The MacOSGlue
framework bundle's Resources folder contains pre-generated SDEF
files for each of its application glues.)
* The command translator may crash or display less-than-optimal/
incorrect information, depending on how many bugs have yet to be
squished in SwiftAutomation.
* The Swift code editor… bless. Of all the hacks, it is the quickest
and dirtiest. (If anyone fancies a crack at improving it, please
fork away and have at it.)
* The immediate goal is to provide a rudimentary Script Editor-like
app that new SwiftAutomation users can use to work through the
tutorial chapter and write simple automation "scripts" using Swift.
## TO DO
* dictionary viewer isn't automatically switching between tab views;
need to fix this so that, at minimum, it displays Suites and Search
tabs correctly (the Inheritance and Containment tabs are far less
useful as they don't work correctly anyway, and even if they did
the UI is really weak; e.g. compare Script Debugger's UI)
* bugs in dictionary viewer and translation doc prevent previously
opened files being reopened after being closed
* integrated glue framework generation + installation (using aeglue);
this might be provided via File menu and/or as "create glue" option
on dictionary viewer
* File>Open Dictionary… menu option that allows user to display an
app's' dictionary by choosing the application itself (see also the
preceding TODO)
* integrate SourceKitten framework for better code formatting
performance and other SourceKit features, e.g. live code checks
(constantly re-running running sourcekitten subprocess is heinously
sluggish and not scalable)
* option for automatically including "#!..." first line and setting
executable flag when saving "scripts", allowing them to be run
directly from Terminal
* improve display of script stdout/stderr/exit messages
* implement SwiftAutoEdit and SwiftAutomation documentation in
Help menu
* fix Script menu's Enabled bindings
* burn it with fire
* total rewrite
* app icon
* better name
## Acknowledgements, Licensing, etc
Some code taken from ,
which in turn is a fork of ,
which in turn requires release under the following CC license:
.
Many thanks to JP Simard and Scott Horn for the SwiftEdit leg-up on
SwiftDocument view, and to Chris Nebel for the voodoo incantations
required to bring OSADictionaryView to life.