Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jakeopolis

macrumors member
Original poster
Oct 27, 2007
97
0
hey, is there a way of linking two applications so when i open or close one, the other opens or closes? specifically, this is to link youcontrol with itunes.

thanks!
 
As a work-around, you could create an Automator action that opens both apps.
 
I have something similar in applescript that opens two applications and monitors them so if one closes so does the other and then itself.
 
I have something similar in applescript that opens two applications and monitors them so if one closes so does the other and then itself.

how did you set that up? i've never used applescript before.
 
but then i'd have to run the workflow instead of opening the apps themselves...

Yes, but you could export the workflow as an app, give it the iTunes icon, and put it in your dock. For the uninitated, it would look and work just like iTunes.

The major problem I see here is when you close one of the apps, it won't automatically close the other...
 
how did you set that up? i've never used applescript before.

I stupidly didn't save it properly when i first made it so i just wrote this, seems to work pretty much the same way.

Open that in script editor and replace the applications to the ones you want in this line "set applist to {"iTunes", "iCal"}" you can even add more applications to the list e.g. set applist to {"iTunes", "iCal", "Mail"}.

Then save it as an application bundle. Then you can put it in the dock and just click on it and hopefully it will work as described above.

EDIT: Fixed something that was broken.

Code:
global applist
global apprunning
set applist to {"iTunes", "iCal"}
repeat with each_item in applist
	tell application each_item to activate
end repeat
set apprunning to true
repeat until apprunning is false
	delay 3
	tell application "System Events"
		set processlist to get name of every process
		repeat with every_item in applist
			if processlist does not contain every_item then
				my quitapps()
			end if
		end repeat
	end tell
end repeat

on quitapps()
	set apprunning to false
	repeat with each_item in applist
		try
			tell application each_item to quit
		end try
	end repeat
return
end quitapps

Top gear time so will answer any questions after that.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.