Script total filesize for checked songs?

GO TO ADMIN PANEL > ADD-ONS AND INSTALL VERTIFORO SIDEBAR TO SEE FORUMS AND SIDEBAR

MN_Ham_iPod

New member
Joined
Oct 20, 2003
Messages
6
Points
0
Location
Minneapolis
27 gigs in iTunes library don't fit into a 20 gig iPod.

Check/uncheck files whenever I feel like changing what music I carry with me. Getting tired of the "not enough room" error then waiting to try again after unchecking more songs.

Is there a script to tell me the total filesize of those songs that are checked in the library?
 
Joined
Jul 1, 2003
Messages
705
Points
0
Location
Providence, RI, USA
Website
dougscripts.com
There is now...

Sorry, it only does mega bytes:

Code:
[SIZE=1]tell application "iTunes"
	set lib to get a reference to library playlist 1
	set tsize to 0
	repeat with t from 1 to (count file tracks of lib)
		tell file track t of lib
			if enabled is true then
				try
					with timeout of 300 seconds
						set tsize to (size) + tsize
					end timeout
				end try
			end if
		end tell
	end repeat
	set tsize to (round tsize / 1024 / 1024 * 100 rounding up) / 100
	display dialog "The size of all enabled tracks is " & tsize & "MB" buttons {"OK"} default button 1 giving up after 15
end tell[/SIZE]
Copy into Script Editor, Save in home > Library > iTunes > Scripts

Let me know.
 

MN_Ham_iPod

New member
Joined
Oct 20, 2003
Messages
6
Points
0
Location
Minneapolis
Re: There is now...

Doug Adams said:
Sorry, it only does mega bytes:

It works perfect and I appreciate your efforts. I wasn't expecting a custom solution, turnkey as it were. Above and beyond the call of duty.....

Thanks. I'm grateful.

Now if only Apple would make it so that I could check/uncheck only highlighted items in a list, rather than *all* of them in the list via command key click. Or else I'm gonna need an 80gig pod within the year.
 
Joined
Jul 1, 2003
Messages
705
Points
0
Location
Providence, RI, USA
Website
dougscripts.com
No problem. And, since you asked...

Check selected tracks:

Code:
[SIZE=1]tell application "iTunes"
	if selection is not {} then
		set sel to get a reference to selection
		repeat with t from 1 to (count items of sel)
			if class of item t of sel is file track then
				set enabled of item t of sel to true
			end if
		end repeat
	end if
end tell[/SIZE]
Uncheck selected tracks:

Code:
[SIZE=1]tell application "iTunes"
	if selection is not {} then
		set sel to get a reference to selection
		repeat with t from 1 to (count items of sel)
			if class of item t of sel is file track then
				set enabled of item t of sel to false
			end if
		end repeat
	end if
end tell[/SIZE]
 
Top