Garry Pettet
Garry Pettet

Reputation: 8288

How can I access the clipboard from AppleScript?

I need to be able to send text from the clipboard to an application I'm writing (in Objective-C) via AppleScript. Obviously I need to make my application scriptable (I'm currently reading the Apple Docs about this) but is this possible/easy-to-implement?

Upvotes: 0

Views: 480

Answers (2)

sakra
sakra

Reputation: 65971

On the AppleScript side you can use the command set the clipboard to to put data on the clipboard. See the AppleScript Language Guide.

Upvotes: 2

Dave DeLong
Dave DeLong

Reputation: 243156

If you need your app to retrieve data from the clipboard, you should use the NSPasteboard class.

Why do you think you need to use AppleScript?

Upvotes: 0

Related Questions