Is it possible with AppleScriptObjC to share the selection for find (from a NSTextField)?
In other words, how to simulate the Use selection for find
that stands in the search menu of many apps?
You use the find pasteboard (NSPasteboard's pasteboardWithName: current application's NSFindPboard
).
Thanks, Shane.
Have a nice day!
Hey Guys,
It would be nice to have a working code example for such things. I for one couldn’t turn the above into working code without help.
-Chris
--------------------------------------------------------
use framework "Foundation"
use framework "AppKit"
--------------------------------------------------------
set |⌘| to current application
set searchString to "%PlaceHolder%"
set findPasteBoard to |⌘|'s NSPasteboard's pasteboardWithName:(|⌘|'s NSFindPboard)
findPasteBoard's clearContents()
findPasteBoard's writeObjects:{searchString}
--------------------------------------------------------