Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Automating a system preference when a program launches.

Hi there. This is my first time posting.


This is a small issue. I'm curious to know if this type of thing is possible, and how I'd go about doing it!


When I launch a certain program (various games, certain audio applications) sometime I need to enable the "use all F1 F2 etc keys as standard function keys" option. However, when I am not using these applications, I would prefer it to be off.


Is there a way to automate this function on and off? For example:


If i Open (program X)

This system preference is engaged.

When I close (program X)

This system preference is disengaged.


Sorry if that sequence makes me sound like an idiot - I have no knowlege of automating tasks/script/code.


Thanks in advance! And if there's a better place I should be looking for this info, please let me know. Thanks again!

-J

MacBook Pro (15-inch Mid 2010), OS X Mountain Lion (10.8.2)

Posted on Jan 25, 2013 9:06 AM

Reply
8 replies

Jan 25, 2013 3:03 PM in response to howmanywhales

Hi guys, and again, thank you.


I got it working as well as I can figure. I used a combination of Applescript and Automator. This is what it looks like:


User uploaded file


The applescript you see in the middle was taken from a similar apple forum. I have NO idea why I needed it. For whatever reason, the "Watch Me Do" function you see at the bottom of my automation simply doesn't work like it's supposed to without that applescript.


Then I saved the whole thing as an "application" and now I launch it from my dock the same way I'd launch anything else. It's awesome.


Now if I only I could figure out how to toggle it back once the program quits.... 🙂


-J

Jan 26, 2013 6:29 AM in response to howmanywhales

Just want to add a few notes here.


The automator "watch me do" function seems really heavily reliant on your screen size, window placement, and display resolution.


Seems funny, no? But if you move around windows on the screen or change monitors, it screws the whole auto process up. Hah. I'm sure there's a better applescript/automator command that could be used in this instance!


Thanks all,


Jan

Jan 26, 2013 7:31 AM in response to Frank Caggiano

I think you're right that a script would be better than an automation record function.


My problem is it's hard to tell exactly what parameters of the given script to change in order for it to select the right option within system preferences.


The other problem would be with how to get automator (or a script) to launch when i'm quitting the application. I see the script for quitting is very easy, but i'm not sure how to get it to launch when the app is quitting.


Thanks for the input Frank!

-Jan

Automating a system preference when a program launches.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.