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

ApolloX

macrumors newbie
Original poster
Feb 1, 2007
9
0
This question is about the "iTunes -> Preferences -> Advanced -> Copy files to iTunes Music folder when adding to library". Normally, I like to keep this setting checked for songs, but recently I wrote an applescript that adds video files stored on a network folder to my iTunes library. Because I don't want to actually download these files to my mac, I had to change the preference to be unchecked anytime the script runs.

Desired Solution: Some way I can keep the copy to libary setting checked most of the time, except when I'm copying video files.

Idea 1: Keep the button copy to libary setting checked but have the script tell iTunes to ignore the copy. Something like "add x to Library without copying"

Idea 2: Have the script turn the copy to library setting off before it begins and back on after it completes. Would need syntax for an applescript to modify this preference.

Anyone know the commands to make either of these ideas work?
 
Hey there. I stumbled onto this thread looking for a solution to the exact same problem! I have been trying (and failing miserably) to build an applescipt myself to complete this exact task. Have you had any luck?

Would you mind sharing any code you have tried? I am seeming to fail at being able to click the "advanced" icon in the popup window. This is my sad attempt after a painstaking few hours:

tell application "iTunes" to activate

tell application "System Events"
keystroke "," using command down
--set current panel of window prefences to Advanced Preferences panel
--click checkbox "Copy files to iTunes Media folder when adding to library"
end tell
 
Hey there. I stumbled onto this thread looking for a solution to the exact same problem! I have been trying (and failing miserably) to build an applescipt myself to complete this exact task. Have you had any luck?

Would you mind sharing any code you have tried? I am seeming to fail at being able to click the "advanced" icon in the popup window. This is my sad attempt after a painstaking few hours:

Try this :

Code:
tell application "iTunes" to activate

tell application "System Events"
	tell process "iTunes"
		keystroke "," using command down
		delay 1
		click button "Advanced" of toolbar 1 of window 1 --"General Preferences"
		-- Check the checkbox if it is checked!
		if value of checkbox "Copy files to iTunes Media folder when adding to library" of group 1 of window "Advanced Preferences" is 0 then
			click checkbox "Copy files to iTunes Media folder when adding to library" of group 1 of window "Advanced Preferences"
		end if
		click button "OK" of window "Advanced Preferences"
	end tell
end tell
 
Try this :

Code:
tell application "iTunes" to activate

tell application "System Events"
	tell process "iTunes"
		keystroke "," using command down
		delay 1
		click button "Advanced" of toolbar 1 of window 1 --"General Preferences"
		-- Check the checkbox if it is checked!
		if value of checkbox "Copy files to iTunes Media folder when adding to library" of group 1 of window "Advanced Preferences" is 0 then
			click checkbox "Copy files to iTunes Media folder when adding to library" of group 1 of window "Advanced Preferences"
		end if
		click button "OK" of window "Advanced Preferences"
	end tell
end tell

WOW thank you so much! that totally worked!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.