Sdef stands for "scripting definition" as used by scriptable Mac OS X applications to specify their Applescript dictionary. It's derived from the related files using the extension ".sdef".
Questions tagged [sdef]
16 questions
4
votes
0 answers
Convert AppleScript sdef to TypeScript .d.ts?
Most OS X applications (particularly the ones written by Apple) are scriptable using either AppleScript or JavaScript. The API each application supports is described by an SDEF file. (See e.g. sdef /Applications/Safari.app.)
Is there any way to…

mjs
- 63,493
- 27
- 91
- 122
3
votes
2 answers
Cannot get Apple's SimpleScripting example to work when using NSApplicationDelegate
I am trying to write a trivial Objective-C application: I just want an app that will display a word in the status bar and allow the word to be updated via AppleScript. To be honest, I know little about AppleScript and nothing about Objective-C. …

Aaron B.
- 31
- 2
2
votes
1 answer
AppScript issues with Cocoa NSString and AppleScript text types?
In one of my Applications I've added a few new properties to the document class of the Standard AppleScript suite. Some of these properties have the type text, others have the type boolean. I've written a "sdef" file and added if to the resources of…

Marc S
- 21
- 1
2
votes
1 answer
Making SwiftUI app Scriptable with AppleScript and Javascript JXA
Please note I have carefully followed How to implement AppleScript support in a Swift MacOS app - however this is not working for me. I assume it's out of date.
After following a variety of documentation, guides, examples, I'm stuck trying to get…

ocodo
- 29,401
- 18
- 105
- 117
2
votes
0 answers
Accessing a property of an object using AppleScript
I'm adding AppleScript support to my macOS application but I have problems accessing a property of an object I defined.
The sdef file resulted in the following directory:
When I run the following script:
tell application "Daily"
get all…

Niels Mouthaan
- 1,010
- 8
- 19
2
votes
1 answer
where can I get a good SDEF editor?
I'm writing an objective C program which will need to be applescriptable. so, I need to create and edit an SDF file. I'd MUCH rather not have to write XML if I don't have to, so I'm hoping that someone can point me to a good editor... I've found…

Brian Postow
- 11,709
- 17
- 81
- 125
2
votes
0 answers
Returning a NSUniqueIDSpecifier in -objectSpecifier with key Key does not result in valueInWithUniqueID: getting evaluated
The reference documentation for the class NSUniqueIdentifier claims that unique ID specifiers are evaluated in the following scheme:
If the container implements a method whose selector matches the relevant valueInWithUniqueID: pattern…

mz2
- 4,672
- 1
- 27
- 47
1
vote
1 answer
How to compile an AppleScript Script Library (scptd) with an Scripting Definition (sdef)
I want to be able to decompile and compile and AppleScript Script Library (scptd) with an Scripting Definition (sdef), so I can put the text source in version control.
The background of this question is to put my AppleScript sources in git. Most of…

doekman
- 18,750
- 20
- 65
- 86
1
vote
1 answer
Calling Swift Methods from AppleScript
I am trying to write an AppleScript that calls my Swift application to get a value. The method takes a string and needs to return another string.
Here is my .SDF file:
…

iphaaw
- 6,764
- 11
- 58
- 83
1
vote
0 answers
Applescript Sdef: How to define assignable commands?
In my scriptable Mac app, I like to make the following syntax possible:
set preference with key to
Is that possible? How would I specify this in the Sdef?
The only way I can so far come up with is to define a command with the name…

Thomas Tempelmann
- 11,045
- 8
- 74
- 149
0
votes
1 answer
How to define a 2-parameter handler in sdef with parens instead of curly braces?
I want to define a handler that I can call like this:
log format("Hello {}", "World") -- #> Hello World
log format("Hello {}, {}", {"World", "Again"}) -- #> Hello World, Again
I defined it in SDEF:

user3579815
- 522
- 3
- 12
0
votes
1 answer
Applescript not accepting arRsync sdef commands?
I'm using the opensource GUI frontend for rsync called "arRsync". It works great, but there's no way to automate it.
What I'm trying to do is use Applescript to run a preset (which you define in the Application) using the following simple…

S0ULphIRE
- 3
- 1
0
votes
1 answer
Get current app information from App.sdef
I'm trying to access information about the current status of a Mac app like I would with dbus on linux.
The app I'm trying to do this with is Spotify. I searched through the package contents and I found there was a Spotify.sdef file in the…

Micah Cowell
- 392
- 4
- 18
0
votes
2 answers
How to support an AppleScript element (a one-to-many relation) of the application (NSApp) class?
Here's what I have:
1) Include the proper "permissions" entries in the 'Info.plist
'Scriptable': YES
'Scripting definition file name': myApp.sdef
2) Include the element "element" tag within a class extension "element" tag:
`

Antony
- 187
- 4
- 15
0
votes
1 answer
Applescript-able Cocoa : Reference to NSArray of objects?
OK. So, let's say :
I've got a class myCollection, a class myObject and a property objects in myCollection returning an NSArray of myObjects
Given that I have properly set up my .sdef file for the myCollection and the myObject classes, how should…

Dr.Kameleon
- 22,532
- 20
- 115
- 223