Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Community > MacNN Lounge > Help me write a quick Applescript

Help me write a quick Applescript
Thread Tools
Mac Elite
Join Date: Apr 2002
Location: Miami Beach
Status: Offline
Reply With Quote
Apr 30, 2005, 03:27 PM
 
I just picked up a Logitech MX1000 and I want to assign one of the buttons to switch to the next song in iTunes. Since the mouse setup isn't that in-depth, I figured Applescript would be a way to do it bc the software lets you set a button to open an App .

The script can be simple - just assume that iTunes is open. The script would have to select iTunes as the active app, then do the 'right arrow' key command. Shouldn't be too complex and I'd do it if I knew anything about Applescript.
     
Professional Poster
Join Date: Oct 1999
Location: Always within bluetooth range
Status: Offline
Reply With Quote
Apr 30, 2005, 03:49 PM
 
It'd be a pretty easy script to write, but to launch and run a mini-app just to change the track would probably take more time than just using the Dock controls for iTunes. Another idea would be to get something like Sizzling Keys that lets you assign global keystrokes to iTunes and then map a mouse button to that keystroke.
     
Professional Poster
Join Date: Oct 1999
Location: Always within bluetooth range
Status: Offline
Reply With Quote
Apr 30, 2005, 03:54 PM
 
Oh, BTW. Here's the script
Code:
tell application "iTunes" activate next track end tell
     
Mac Elite
Join Date: Apr 2002
Location: Miami Beach
Status: Offline
Reply With Quote
Apr 30, 2005, 04:08 PM
 
I love answering my own stupid questions...

tell application "iTunes"
activate
end tell

tell application "iTunes"
next track
end tell
     
Mac Elite
Join Date: Apr 2002
Location: Miami Beach
Status: Offline
Reply With Quote
Apr 30, 2005, 04:10 PM
 
**forgot to refresh the thread before I replied. Thanks Krusty**
     
Mac Elite
Join Date: Apr 2002
Location: Miami Beach
Status: Offline
Reply With Quote
Apr 30, 2005, 04:28 PM
 
tell application "iTunes"
activate
next track
close every window
end tell
This one is better bc it gets rid of the window. (You can click on the dock icon to show it again)
     
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
Apr 30, 2005, 06:25 PM
 
I don't think you need the "activate" step. That only brings it to the forground.
     
Professional Poster
Join Date: Oct 1999
Location: Always within bluetooth range
Status: Offline
Reply With Quote
Apr 30, 2005, 06:55 PM
 
Originally Posted by hayesk
I don't think you need the "activate" step. That only brings it to the forground.
You're right ... I didn't even think of that. Just drop the "activate" rozwado and then you can drop the close every window portion too... it'll just advance the song in the background if you have no windows open.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:16 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2