« [mdimport]スポットライトのインデックスに追加する | トップページ | [UUID]デバイスUUID »

[検索]ペーストボードの内容をNSWorkspaceで検索

【スクリプトエディタで開く】

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
#   com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

###クリップボードの内容をテキストで取得
set appPasteboard to refMe's NSPasteboard's generalPasteboard()
set ocidReadPasteboard to appPasteboard's stringForType:(refMe's NSPasteboardTypeString)
####検索
set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()
appNSWorkspace's showSearchResultsForQueryString:ocidReadPasteboard



#!/bin/bash
osascript <<-EndOfScript
use AppleScript version "2.4"
use framework "Foundation"
use framework "AppKit"
use scripting additions
set theQuery to the clipboard as text
current application's NSWorkspace's sharedWorkspace()'s showSearchResultsForQueryString:theQuery
EndOfScript

|

« [mdimport]スポットライトのインデックスに追加する | トップページ | [UUID]デバイスUUID »

AppleScript Spotlight」カテゴリの記事