nate-parrott / Flashlight

The missing Spotlight plugin system
http://flashlight.nateparrott.com
Other
5.39k stars 411 forks source link

I make 'TimeMachine Backup start immidetly' plugin. But it works only flashlight tool. Is it normal? #331

Open say8425 opened 9 years ago

say8425 commented 9 years ago

Like this screen shot FlashlightTool can search tmback start and work 2015-02-18 4 33 51

But in real Flashlight can not find tmback and work. And I think it has little bug. Could you help me please?

plugin.py


import i18n

def results(parsed, original_query):
    message = parsed["~message"]
    title = "TimeMachine backup"
    return {
        "title": "{0} {1}".format(title, message),
        "run_args": [message]
    }

def run(message):
    import os
    if message == 'start':
        os.system('tmutil startbackup')
    elif message == 'stop':
        os.system('tmutil stopbackup')
    else:
        pass

examples.txt

tmback ~message(start)
tmback ~message(stop)

info.json

{
  "creator_url" : "https://twitter.com/say8425",
  "creator_name" : "northPenguin",
  "categories" : [
    "Utilities"
  ],
  "name" : "TimeMachineBackup",
  "description" : "Timemachine backup start or stop imedetly",
  "examples" : [
    "tmback start",
    "tmback stop"
  ]
}
nate-parrott commented 9 years ago

Have you tried restarting Flashlight? Turn "Enable Spotlight Plugins" off and on again. Does that fix the issue?

say8425 commented 9 years ago

I did it already. But it's not works.

nate-parrott commented 9 years ago

is the i18n.py module included in your plugin's directory?