Jump to content

joshnh

Member
  • Posts

    5
  • Joined

  • Last visited

Posts posted by joshnh

  1. 10 minutes ago, deanishe said:

    I've built a simple workflow.

     

    There are start and stop keywords to, well, start and stop the script.

     

    The actual script, ticker.py, is inside the workflow folder. Right-click the workflow in Alfred Preferences and choose "Open in Finder" to see it.

     

    By default, the script calls the workflow's notify External Trigger every 300 seconds (5 minutes). I've connected that to a Play Sound action, but you can connect it to any kind of action (or multiple actions).

     

    You can change the interval by adjusting the INTERVAL setting in the workflow's configuration sheet by clicking the [?] icon. The value is in seconds.

     

    I've never written python, but I understand the logic behind it. Thank you so much for taking your time to do this. It's greatly appreciated.

  2. 2 minutes ago, deanishe said:

    It's very simple as far as scripts go. A few lines. 

     

    I'll happily write it for you, but you'll have to tell me what you're actually trying to do: the workflow as you've described it doesn't actually do anything. It just starts then stops. 

     

    That would be awesome!

     

    I need a notification with a tone to occur every 5 min. This needs to keep repeating until I stop it.

     

    I'd be more than capable of making adjustments as necessary once I saw how the script was written.

  3. Just now, deanishe said:

    It sounds like Alfred considers those to be two separate workflow processes.

     

    The way I'd do it is with a script that loops. It would delete a "stop" file on start up, then check every second to see if it exists. If it does, the script exits (possibly deleting the "stop" file).

     

    Your stop command would create the "stop" file.

     

    You could also write the looping script's PID to a file, then read it and kill the process with your stop command. 

     

    Scripting is out of my realm, and I was hoping it would be a relatively simple thing to accomplish, but perhaps not...

  4. My thinking so far has been to begin the core of the workflow with an external trigger that is started when using a keyword input. The workflow then runs once (with a delay set during the workflow), checks that the variable "continue" is still set to "yes", and if it is the workflow ends by calling the same external trigger that starts it, triggering the loop. I then have a separate keyword input to set the "continue" variable as "no", so that when the loop next gets to the filter it doesn't continue, but it's not stopping the loop as hoped.

×
×
  • Create New...