Remapping Apple Remote keys with AppleScript and SofaControl

Hello,
I am attempting to write a bit of code in AppleScript to map the buttons on my Apple Remote to certain keys on my keyboard.
This is all I want:
(Remote = Keyboard)
left = Fn+F7
right = Fn+F9
play/pause= Fn+F8
(You might notice these are the media keys)
I am using an application from the app store call SofaControl for this, I know no other way (ControllerMate won't give me general access to the Apple Remote).
The problem with SofaControl is that it seems to be application specific, which is annoying: I don't want to be switching applications to play or pause a song on Spotify.
Advanced information
SofaControl gives you a few (what look to be) functions for assigning keys to buttons, here is an example of a preinstalled Spotify script:
on rcActivate()
          -- this code is executed when the script is activated
          -- typically the target application gets activated
          ignoring application responses
                    tell the application "Spotify" to activate
          end ignoring
end rcActivate
on rcPlay()
          -- send Space to Spotify
          simulate keycode 49
end rcPlay
on rcLeft()
          -- send Command-Left Arrow to Spotify
          simulate keycode 123 with command
end rcLeft
on rcRight()
          -- send Command-Right Arrow to Spotify
          simulate keycode 124 with command
end rcRight
on rcPlus()
          -- send Command-Up Arrow to Spotify
          simulate keycode 126 with command
end rcPlus
If anyone can help, I'll reiterate my simple requirments:
I do NOT want this to be application-specific, I have disabled all other pre-installed scripts that came with SofaControl, so this should be the only one with access to the remote. (I want to control the media key from any space/desktop I'm on.)
I just want the three afforementioned keys mapped, nothing else. I'm hoping this is as simple as:
     (*for the play button*)
     on rcPlay()
            simulate keystroke "Fn"+"F8"
     end rcPlay
          … or something like that (don't laugh, I don't know AppleScript!!)
Hopefully it isn't that complicated and someone can help. I'm only asking because I really don't want to learn AppleScript just for the sake of doing this.

You'll need a program such as ired lite or mira or remote buddy to do that, but yes, it's possible.
http://www.filewell.com/iRedLite/
http://twistedmelon.com/mira/
http://www.iospirit.com/remotebuddy/

Similar Messages

  • If I were to purchase the Apple Remote Desktop with Unlimited licenses, would I be able to install the client software on each of there computers/laptops and have them remote desktop into the server?

    I have several friends and family who are looking for a central place to access information from ( Pictures, home movies etc ).  So I am considering setting up an OSX Lion Server.  There are some other things I can use it for as well.
    Here is my question:
    If I were to purchase the Apple Remote Desktop with Unlimited licenses, would I be able to install the client software on each of there computers/laptops and have them remote desktop into the server?  Or would I have to install the Admin software on each?  Do they intend it to be used strictly as one admin to access many clients? 
    I always could set up a network drive so they can log in and just see the folders they have created with space on the server I provide them.  But I want them to be able to log an and actually use it as a Remote Desktop.
    Thanks,
    Eric

    Dave,
    Thanks for the feedback.  I understand that ARD is meant for Remote Administration, but I was not sure if it could be used for my purpose as well.  The reason I was looking to do it this was was because I read several articles online about security and performance issues with setting up VNC and activating screen sharing.  Unless I am misunderstood. 
    As far as people's activities on the server, mostly it is going to be used as a place for them to store their media.  I will only allow own person ( Who I trust and I know wont botch the server ), to run applications.  Everyone else will be restricted to uploading and downloading content to their designated account on the server as well as a community share on the server.
    I appreciate your help.
    Thanks,
    Eric

  • DOES THE APPLE REMOTE WORK WITH THE IPOD TOUCH..? WITHOUT A DOCK..

    HI
    DOES THE APPLE REMOTE WORK WITH THE IPOD TOUCH 5TH GEN..? WHITHOUT A DOCK..??
    THANKS ANYONE

    This Apple remote requires a dock since this remote uses IR and the iPod does not ha IR capibility,.
    Manufacturer Information
    Apple Remote with iPod and iPhone: Please note a Universal Dock is required in order to use the Apple Remote with your iPhone or iPod.
    http://store.apple.com/us/product/MC377LL/A/apple-remote?

  • How do I use my apple bluetooth keyboard with touch and will I still be able to use it with my ipad?

    How do I use my apple bluetooth keyboard with touch and will I still be able to use it with my ipad?

    iPod touch User Guide (For iOS 4.3 Software)

  • It´s possible to use the "Remote" app with Itunes and a Nokia E72 with Joikuspot installed only? Or I´ll need to buy a modem Wifi?

    It´s possible to use the "Remote" app with Itunes and a Nokia E72 with Joikuspot installed only? Or I´ll need to buy a modem Wifi?
    I was using "remote" with a D-link modem, that works fine at my iPad. But now I´m using only the cell phone as modem 3G, and don´t want to intall a router to put new cables at my notebook.

    What?
    You want to control iTunes on your computer using the Remote app on your iPad?
    And you want to connect the iPad and computer through your Nokia?
    No, this will not work.
    Just create a network with your notebook.

  • Does the apple remote work with the ipod touch 4th gen?

    Does the apple remote work with the ipod touch 4th gen?

    Yes, but it also requires Apple's Universal Dock to go along with it.  Otherwise, it is useles.
    B-rock

  • Does the Apple Remote work with Keynote '08 to make presentations with?

    The subject pretty much asks the question, but I'll repeat it here again:
    Does the Apple Remote work with Keynote '08 to make presentations with?

    Although it does not provide the same abilities as a "professional" clicker it does do the job. For example your computer still has to be in front of you, or you need to be pointing at it. Steve Jobs does not use an Apple remote as his clicker, but as a easy solution, it does the job.

  • How can I get my Apple Remote to play/pause and do other functions on all applications?

    When I press the F8 button on my Macbook, it plays or pauses the media for whatever media application I have open, whether that's iTunes, VLC, or MPlayerX. Same goes for F7 and F9, which are backwards and forewards respectively.
    Well I recently bought an Apple Remote and expected that the same thing would go for the remote; the play/pause button would give the same command as the F8 button, so I could use the remote on whatever application that also supported the F7, F8, and F9 buttons. But apparently, that's not the case; so far I've only been able to control iTunes.
    So is there any setting I can change or program I need to install to have the Apple Remote buttons work just like the keyboard media buttons? I tried Remote Buddy, but that's not giving me specifically what I want since it's only designed to make specific programs compatible. But they still don't support for example MPlayerX, which is my default video player.

    Gosh, that must explain why it didn't come with a magic hat!
    I completely accept the fact that Apple designed it to do a limited set of functions, but in the post I asked if there was any program that I can install that causes it to do hit the function keys for me. There's already Remote Buddy, which intercepts remote signals and performs specific functions instead of the normal ones. How then can there not be a program that also intercepts them, but hits the function keys? Seems to me that that would be even easier than what Remote Buddy's doing.

  • Incorrect Apple Remote behaviour with Eye TV under OS X 10.6.7

    After upgrading to 10.6.7 my Apple remote began to misbehave in a very specific and reproducible manner when used with Eye TV (3.5.1 with a Diversity Tuner).
    When pressing and holding to fast forward (as opposed to brief press to skip) the programme know stays in fast forward when the remote button is released. pressing any key (the play button, the centre silver button, or the fast forward key again) pauses playback.
    Playback will not resume until the menu button is breiefly pressed, initiating Frontrow. On Return to Eye TV playback immediately resumes.
    This problem has only begun since the upgrade, all worked fine prior to that.
    I have tried using Candleair IR remote driver in both normal and legacy mode. Makes no difference.
    All hardware is less than 6 months hold (iMac 27", Elgato Diversity, Apple Remote), latest version of Eye TV and OS X.
    Anyone else observed this behaviour and/or know of a solution?
    Cheers

    I had the same problem, Elgato has an update which solved it.
    http://support.elgato.com/index.php?m=knowledgebase&a=viewarticle&kbarticleid=4108&nav=0

  • Unable to pair Apple Remote App with iTunes

    I am running a Toshiba Satellite L505D-S5965 with Windows Vista SP 2. My iTunes software is 8.2.1.6, and my iPhone 3GS is running OS 3.0.1 (7A400). Both the Satellite and iPhone are connected to the same WiFi local network, and yet the App "Remote" by Apple Software is unable to communicate with iTunes to allow the entry of the four digit code to establish control of the iTunes library. Shortly after purchasing the iPhone 3GS I purchased the Satellite, but in the couple of weeks between the purchases the Remote App worked fine on my Gateway running Windows XP SP2. I have been through Apple Telephone support twice, and have really run one of the technicians through the mill researching possible solutions. I have visited an Apple Store Genius, who could find no reason for the problem. The iPhone and Remote App worked perfectly well on the store's WiFi and Mac, but his iPhone also wouldn't work with my laptop. I have been through Kaspersky's technical support system to ensure that there isn't a firewall issue. They have assured me, after reviewing logs from my laptop, that this is not the case. I even went so far as to uninstall all my Kaspersky product, but the Apple Remote App still would not function properly. I have updated the router's firmware, and checked that the laptop's wireless card is running the latest driver. At this point I can't think of anything else to try but would really appreciate any suggestions. Thanks, Steve

    Monday 7th Jan.
    Just to say that Apple did call me this am to discuss the problem on foot of a call I made last week.
    In the meantime the remote worked with both a 2007 IMac and a 2009 laptop but not on the m-mini.
    When I tried  pairing this morning during the call by pressing Menu and next together it paired.
    The change is very subtle, it just says paired in the advanced section of the security et sl section as referred before, with a fleeting 2 intersecting rings icon.
    The big difference is that Front Row is gone....
    The remote only works to a limited degree within some apps such as iTunes and iPhotos.
    In theory it controls the volume in iTunes but as of now for me  it doesnt....:( need to look more.
    As to what the problem was:
    It seems there is a set of keyboard combinations that can be used to force a  reset the ID of the remote, the suggestion is  MAYBE that by getting it to work on the iMac and laptop in some way reset the ID.
    This stuff  is WAY beyond my skill level:)
    I did impress upon Apple the need to look at the issue in threads like this....
    Message was edited by: qazxsw52

  • Help with Applescript and Admin Privelages

    I just started using Applestript a few months ago and I can't figure out how to give my script Admin rights. Basically, it turns on and off my internet sharing and file sharing through dialog boxes. I copied and pasted the whole code below if you want to test it, but this is the part that is giving me trouble. There are 4 lines similar to this, the actions that turn on or off the services.
    do shell script "/bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist" with administrator privileges
    I've tried adding "with password _____" and "password_____" but neither worked. Can anyone help me make this script authenticate itself so I don't need to keep typine in my password? I could easily make a keystroke in system events to type it in but it doesn't always ask for it so I don't know how I'd make the script know when it needs to enter the password. any help is much appreciated!
    Some things to clarify: The first shell script is there to invoke the "authentication" dialog so I can sign in once I launch the app and get right into the settings. However, I'd like to make it so the script doesn't even need admin permission to run, or make it somehow have my password built in to it. Security is not an issue, its my personal computer that nobody else has access to so I really don't care if my password is written in the code. Also, if you have any tips on how to streamline the Quit/Hide/Resume dialog I'd appreciate that too. Resume is there because there's a chance I won't have to sign in again if the app does not quit, however more often than not I have to sign in anyways. Thanks again in advance, sorry this post is so long but like I said, I'm pretty new to all this so I don't know exactly what you need to be able to help me.
    The Whole Script:
    -- Variables and Authentication
    set done to "n"
    set quitapp to "no"
    display dialog "Please enter your password to allow Sharing Manager to make changes to your settings." with icon caution
    do shell script "/bin/launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist" with administrator privileges
    delay 0.2
    -- Repeats
    repeat while quitapp is "no"
              repeat while done is "n"
      -- Choose Setting
                        display dialog "Choose Setting to Edit" buttons {"Internet", "File Sharing", "Exit"} default button 3
                        set the button_pressed to the button returned of the result
                        if the button_pressed is "Internet" then
      -- Commands for Internet Settings
                                  display dialog "Internet Sharing" buttons {"On", "Off", "Cancel"} default button 3
                                  set the button_pressed to the button returned of the result
                                  if the button_pressed is "On" then
                                            do shell script "/bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist" with administrator privileges
                                  else if the button_pressed is "Off" then
                                            do shell script "/bin/launchctl unload -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist" with administrator privileges
                                  end if
                        else if the button_pressed is "File Sharing" then
      -- Commands for Sharing Settings
                                  display dialog "File Sharing" buttons {"On", "Off", "Cancel"} default button 3
                                  set the button_pressed to the button returned of the result
                                  if the button_pressed is "On" then
                                            do shell script "/bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist" with administrator privileges
                                  else if the button_pressed is "Off" then
                                            do shell script "/bin/launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist" with administrator privileges
                                  end if
                        else
                                  set done to ""
                        end if
              end repeat
      -- Confirm Quit/Hide
              display dialog "Really quit? You will have to reenter admin info next time." buttons {"Quit", "Hide", "Resume"} default button 1
              if the button returned of the result is "Quit" then
                        set quitapp to ""
              else if the button returned of the result is "Hide" then
                        tell application "System Events"
      keystroke "h" using command down
                        end tell
              else
                        set done to "n"
                        set quitapp to "no"
              end if
    end repeat

    with respect to general improvements, a couple of points:
    If I'm reading this script correctly, it looks like you're putting up an applescript alert and leaving it hanging until it's dismissed.  This is an atypical approach (applescripts aren't really meant to hang around indefinitely waiting for a respons).  If I were doing this I would either go whole-hog and create an applescript application in XCode with a proper interface, or remove the hanging dialog and create a set of toggle scripts that I could use from the script menu.  if you really want to keep the hanging dialog, though, you can streamline it by absorbing the secondary dialogs into the main dialog.  that's like so:
    set netSharingStatus to checkService("com.apple.InternetSharing")
    set fileSharingStatus to checkService("com.apple.AppleFileServer")
    display alert "Current Settings" message "Click to change settings" buttons {"Internet " & netSharingStatus, "File Sharing " & fileSharingStatus, "Exit"} default button 3
    -- choose next action based on the button clicked and the status vairable
    on checkService(service)
              do shell script "launchctl list"
              if the result contains service then
                        return "On"
              else
                        return "Off"
              end if
    end checkService
    using handlers like the above can also streamline the rest of your script.  the following construction means you only have to write the do shell script line once, rather than the four times you currently do, and makes for much cleaner reading.
    if the button_pressed starts with "Internet" then
              toggleService("com.apple.InternetSharing", netSharingStatus)
    else if the button_pressed starts with "File Sharing" then
              toggleService("com.apple.AppleFileServer", fileSharingStatus)
    else
      --exit routine
    end if
    on toggleService(service, currentState)
              if currentState in "On" then
                        set action to "unload"
              else
                        set action to "load"
              end if
              set command to "/bin/launchctl " & action & " -w /System/Library/LaunchDaemons/" & service & ".plist"
              do shell script command user name "adminusername" password "password" with administrator privileges
    end toggleService

  • Using Apple Remote Desktop with Audio Applications

    Hello, I am configuring a setup consisting of a Mac Pro with Mac OS 10.4.9 running Logic Audio and a Mac G5 Quad with Mac Os 10.4.8 running Protools HD.
    I am considering using a Gefen Systems KVM switcher, or Apple Remote Desktop.
    Has anyone had any experience using Apple Remote Desktop to run Protools?
    Scott

    if all you need is to be able to control another computer, then ARD would be overkill. Look into the freeware VNC. That will give you control capabilities and not cost you anything. You can find VNC applications for Mac here. Most people seem to find Chicken of the VNC works well for them.

  • Getting the Apple Remote working with PowerPC

    Is there anyway of getting the Apple Remote to work with a PowerPC PowerMac G5? On my MacBook i have Front Row and it's awesome, but i really want something like that on my desktop. There's an app called MediaCentral:
    http://www.equinux.com/us/products/mediacentral/index.html that will work will all Macs so now all i need is a good remote.
    I have the AirClick and it's alright, but i find it quite slow and i can't sleep the computer with it. So is it possible to get the Apple Remote working in any way?
    Cheers

    Front Row first shipped with the G5 iMacs. The version on the install DVD that came with your MacBook should be a Universal Binary, and should install on your iMac.
    You will need to use an app called Front Row Enabler, but that's only because Front Row checks to make sure your Mac has a built in IR receiver.

  • Need help with applescript and Xcode 4.3.2

    I'm trying to write my first application that will involve a GUI. I can code applescript using script editor with a bit of effort, but I'm want to have users input more than one piece of information in the pop up. So, I download xcode, create my first applescript cocoa project go to MainMenu.xib and add a bunch of labels, text fields and buttons. Looks fairly nice... Go to start it and... nothing (well the window pops up, but it doesn't do anything). Unfortunately, I haven't figured out how to link the window to the applescript... So, how do I...
    * Have the applescript prepopulate data in the text fields and pulldowns
    * Once the user changes the data in the fields tell the applescript
    * Tell the window to close and pass the control back to the applescript once either the cancel or submit button is pressed.
    More detailed...
    * What's an outlet and how do I use it here? Which of the 18 outlet(s) do i use for this?
    * What's a property (referenced on one of the web pages I saw around applescript and cocoa) and do I need them here?
    Looking at the documentation with xcode, there isn't a lot about xcode and applescipt. Looking at the web, the top links are a few years old. So, links to good relevent documentation would be very nice as well as direct answers to the questions
    Thanks,
    Scott

    I'm not sure why you are closing it, but the NSApplication class is what keeps track of the windows.  If you don't want to connect the window to an outlet from the interface editor, you can use something like
    set theWindow to current application's NSApplication's sharedApplication's mainWindow()
    ...and from there you can use whatever NSWindow methods, for example
    theWindow's performClose_(me)

  • How to setup apple time capsule with FIOSinternet and VZ router?)

    Hello,
    I have Apple time capsule and the VZ Router MI424WR. I current set up:
    1. VZ router - wireless off, the rest is standard
    2. Time capsule: Wireless on in Bridge mode
    Result: Internet works but the wireless network is very in-stable. Airtunes is nearly not usable.
    I searched in the Internet and there was several comments that is is not a good combination. Therefore it is recommended to convert the VZ router in a modem mode and use only the Time capsule as the router. I tried this several times I do not get it to work. I followed this procedure (http://data.agaric.com/node/2160) but then I need the PPPoE Account number and password. But there do I get this? The Verizon support was not really helpful.
    Please, is there a good and complete description to solve that issue?
    Thanks in advance
    Moebius

    Go back to your first setup ...
    Verizon router with wireless turned off
    Apple Time Casule with wireless turned on
    Method 1:
    With the Time Capsule in "Bridge Mode", if I remember correctly, you should connect the WAN port to one of the open ports on the Verizon router (I believe bridge mode also turns off the DHCP server on the Time Capsule, if not, find that and turn if off as well).   Change the addressing mode for the Time Capsule to "static" and assign it an address on the LAN which is not in use (choose something you know is out of the way but on the LAN -- I suggest 192.168.1.180 to start -- you can change it once you get everything working).
    If it doesn't work this way for you, move the cable from the WAN port on the Time Capsule to Port 1 and try again.
    Method 2:
    This results in a router behind a router setup, but unless you have devices connected directly to the Verizon router, it shouldn't be a problem.  
    With the Time Capsule disconnected from the Verizon router, turn on "Connection Sharing" (not bridge mode) and make sure DHCP is enabled on the Time Capsule.  You need to change the address range being used by the Time Capsule (which I think defaults to 192.168.1.x to another network -- I suggest, 192.168.2.x with a netmask of 255.255.255.0 and give the router an address of 192.168.2.1 on the LAN side.  Now, connection the WAN port to one of the Verizon router LAN ports.  If you had anything connected to the Verizon LAN ports, move those over to the LAN ports on the Time Capsule and reboot them.
    Method 3:
    This is the least desirable of the scenarios because it relies on Verizon's crappy radio in their router (the Time Capsule has a much better radio and support 802.11n as well as b and g) whereas Verizon's only support b/g.    Go back to the configuration for Method 1, but also turn OFF wireless on the Time Capsule and turn on wireless on the Verizon router.   Try both bridge scenarios described -- using the WAN port first and if that didn't work, then moving the connection to port 1.
    There is no scenario where you can place the Verizon router behind the Time Capsule -- since I believe Verizon is using all MoCA connections for the WAN side of their connection (you'd have to get Verizon to convert you to ethernet WAN and then they would not support you most likely for any STB issues with your FiOS if the Time Capsule was between the ONT and their router ... so don't even bother wasting time there ... more headaches than it would be worth.
    If you're still not sure exactly what each configuration screen on the time capsule should say, post some screen snaps (or the configuration settings/choices which you are unsure about and someone will likely know the answer here).

Maybe you are looking for

  • Can i upgrade 8.6 to osx on an imac g3?

    i'm looking at getting one since my ibook died and i'm skint bit the one i wnt runs on 8.6. is it possible to update it to 10.2.8ish? how easy is this to do? thank you for your help, lou x

  • FBL1( VENDOR LEDGER REPORT)-  Withholding tax amount is not coming .

    in FBL1 ( vENDOR lEDGER rEPORT) - WITHHOLDING TAX AMOUNT IS NOT CMING IN COLUMN  QBSHB OF FBL1. Purchasing document number is not coming also. How these fields may appear in the above said report. Is any config missing ? Thanks in advance M K Agarwal

  • To take printout of purchase order

    Hi to all please tell me how to take printout of Purchase order once output message is generated. Please guide me... Regards Anubhav

  • Host string problem while connecting to JDBC

    I am using oracle 9i... following code used to connect to sql using usrename "scott" and password "tiger" Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:pawan", "scott","tiger"); where "pawan" D

  • Can you buy firewire cable for usb external?

    i recently bought an Iomega external HDD for time machine, it's a usb based drive, i really regret it because it's so slow. Could i just buy a firewire cable and use it on the drive so it can go faster?