Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How Flashlight Works Internally

Nate Parrott edited this pageMar 23, 2015 ·1 revision

Note: this is slightly out-of-date, but more or less accurate

TheFlashlight.app Xcode target is a fork ofEasySIMBL (which is designed to allow loading runtime injection of plugins into arbitrary apps) that's been modified to load a single plugin (stored inside its own bundle, rather than an external directory) into the Spotlight process. It should be able to coexist with EasySIMBL if you use it.

The SIMBL plugin that's loaded into Spotlight,SpotlightSIMBL.bundle, patches Spotlight to add a new subclass ofSPQuery, the internal class used to fetch results from different sources. It runs a bundled Python script, which usescommanding to parse queries and determine their intents and parameters, then invokes the appropriate plugin'splugin.py script and presents the results using a custom subclass ofSPResult.

SinceI'm not sure how to subclass classes that aren't available at link time, subclasses of Spotlight internal classes are made at runtime usingMike Ash's instructions and helper code.

The Spotlight plugin is gated to run only on versions911-916 (Yosemite GM through 10.10.2 seed). If a new version of Spotlight comes out, you can manually editSpotlightSIMBL/SpotlightSIMBL/Info.plist keySIMBLTargetApplications.MaxBundleVersion, restarts Spotlight, verify everything works, and then submit a pull request.

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp