# Help: TriggeredScript for EyeTV - shutdown unless Plex is running

**URL:** <https://forums.plex.tv/t/help-triggeredscript-for-eyetv-shutdown-unless-plex-is-running/4468>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [August 27, 2010, 2:54pm UTC](https://forums.plex.tv/t/help-triggeredscript-for-eyetv-shutdown-unless-plex-is-running/4468 "2010-08-27T14:54:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomner](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Thomner](https://forums.plex.tv/u/Thomner)\
**Post date:** [August 27, 2010, 2:54pm UTC](https://forums.plex.tv/t/help-triggeredscript-for-eyetv-shutdown-unless-plex-is-running/4468/1 "2010-08-27T14:54:10Z")

</div>

Hey all,  
  
  
  
I know that this dosen’t directly deal with Plex, but I hope that someone can help me anyway 🙂  
  
  
  
I’m using EyeTV and Plex and I have a dream about getting a script for EyeTV, that shutdown my Mac after end recording and exporting, unless Plex is running.  
  
  
  
Does anyone has a script like that or can anyone maybe build one? This could be really fantastic!  
  
  
  
  
  
Btw, I did ask on the forum of EyeTV. You can see the thread here: [http://forums.elgato.com/viewtopic.php?f=91&t=1045&p=41227#p41227](http://forums.elgato.com/viewtopic.php?f=91&t=1045&p=41227#p41227) but I can’t get it to work :S

---

<div class="post-metadata">

**Author:** ![Doosje](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Doosje](https://forums.plex.tv/u/Doosje)\
**Post date:** [August 31, 2010, 11:58am UTC](https://forums.plex.tv/t/help-triggeredscript-for-eyetv-shutdown-unless-plex-is-running/4468/2 "2010-08-31T11:58:30Z")

</div>

This should get you going

```auto

<br />
tell application "System Events" to set theCount to the count of (processes whose name is "Plex")<br />
if theCount = 0 then<br />
	-- do something because it's not running<br />
else<br />
	-- do nothing<br />
end if<br />

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 8:41pm UTC](https://forums.plex.tv/t/help-triggeredscript-for-eyetv-shutdown-unless-plex-is-running/4468/3 "2019-12-20T20:41:21Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
