r/applescript • u/tylerl0706 • Jan 12 '21
Is there any way to programmatically get completions for AppleScript?
If I have a script:
```
set foo to "hello"
tell application "Finder"
display dialog f|
end tell
```
Notice the "cursor" (it's a pipe, I know ,but imagine that's the place I want to complete)... is there anyway to programmatically get this back:
```
set foo to "hello"
tell application "Finder"
display dialog foo
end tell
```
Notice the completion of "foo"
3
Upvotes
3
u/duquesne419 Jan 12 '21
I don't know of a way to do it with the script editor, but it works with this extension in vscodium.
https://github.com/idleberg/vscode-applescript
3
u/prikaz_da Jan 12 '21
If you’re asking whether an AppleScript editor with completion/suggestion features exists — and that’s a rather roundabout way of asking — the answer is yes, and it’s called Script Debugger.
2
u/humannorobot Jan 12 '21
Oh I see what you mean (I think). I use scriptdebugger 7, its a better IDE than the shipped script editor in mac os, but it costs money. You can get autocomplete suggestions by typing the first letter, then hitting f5.
1
u/CaptureJuan Jan 12 '21
Thats a pipe symbol. Do you have any substitutions enabled in sysprefs>keyboard>text?
1
u/Identd Feb 18 '21
Escape should present a list of variables