Name

the clipboard

Synopsis

get clipboard

get clipboard

Gets the clipboard text, or you can specify some other class. A common trick is to specify as record; in the resulting record, the names of the items are their classes, and the values are their values.

-- user has copied a file's icon in the Finder
set r to the clipboard as record
-- {string:"Hawaii Itinerary.pdf", «class ut16»:"Hawaii Itinerary.pdf",
«class hfs »:«data hfs 0000...0000», «class utf8»:"Hawaii
Itinerary.pdf", Unicode text:"Hawaii Itinerary.pdf", picture:«data PICT0A38...000FF»,
 «class icns»:«data icns6963...0000», «class furl»:file
"feathers:Users:mattneub:Desktop:Hawaii Itinerary.pdf"}
type identifier of (info for «class furl» of r) -- "com.adobe.pdf"
the clipboard as «class furl» -- works too

Get AppleScript: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.