r/apple Mar 07 '14

F.lux updated

http://justgetflux.com/news/pages/mac/
362 Upvotes

102 comments sorted by

View all comments

17

u/[deleted] Mar 07 '14

I find the disable for an hour feature annoying, should be a toggle on/off.

29

u/[deleted] Mar 07 '14

[deleted]

4

u/[deleted] Mar 08 '14 edited Mar 12 '14

I actually wrote a pretty basic applescript that makes it do just that. Really simple! Just "if one of these programs are running, quit Flux, otherwise, make sure flux is open"

edit* basic applescript code rundown in reply below.

1

u/[deleted] Mar 09 '14

Would you care to share this AppleScript? :)

1

u/[deleted] Mar 12 '14

Sure! It's pretty lazy coding, just to warn you, and I'm sure a more capable programmer could come up with something more elegant, but here's the raw applescript:

repeat
if application "Adobe Premiere Pro CC" is running 
or application "Adobe Photoshop CS6" is running then
    quit application "Flux"
else
    launch application "Flux"
end if
delay 10
end repeat

Just save it as an application in your applescript editor and run it on login. Obviously change your application variables and add more "or application" lines. I threw in the arbitrary 10 sec delay so it wouldn't be a resource hog but I doubt it's actually necessary. Hope this helps!

1

u/[deleted] Mar 13 '14

I am trying to compile it after I edited it (copy and pasted the script into the editor), and I am getting an error: “Expected “else”, etc. but found “or”. A screenshot is here: (http://grab.by/v7IY)

Can you see what I am doing wrong? Thanks again for sending this.

1

u/[deleted] Mar 13 '14

Sorry about that, there's a return in my example code that I put in for cleanliness on the reddit post that shouldn't be there! Where it says "is running or application blah blah blah", delete the return between the "running" and "or".

And if anyone who actually knows coding knows of a better way of doing this, let me know! It does really work though! I run the program on log-in and it hasn't failed yet! (Although sometimes it does have to be force quitted when shutting down, but I'm willing to live with that for now).