Become a member of the iLounge Forums. Register Now!
To start viewing messages, select the forum that you want to visit from the selection below.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.

Topic: Video Dimensions to Comments script help needed

Reply Thread Tools Topic Search
 
Old 07-06-2008, 03:35 PM
#1
 
Freshman Lounger
 
Join Date: May 2006
Posts: 7
Video Dimensions to Comments script help needed

Hi everybody,

I want to include the "Video Dimensions" information in a visible column of my video collection.
Like this:


Even though it will be horrendous work to set one by one manually.
This looks like a task for an Apple Script for iTunes.

I would like to have one that makes this job for me.
An Apple Script that writes the "Video Dimensions" information automatically into the "Comments" space and if something else is previously there, that "Video Dimensions" would be added and placed at the beginning.
From here to there:

So:
Could somebody please tell me where to find it, if it's already been made? if not, how to write it, if there is a tutorial for neophytes somewhere out there? if not, how to modify one like "FileCreationToComment" script as it was made in the following thread "Need a script: "Last Listened Date" to "Text box" ? or the best, can be generously written and posted by one of the Black Belts that hang around here?

Thank a lot,
MacDream

Last edited by MacDream; 07-06-2008 at 03:55 PM.
MacDream is offline  
Reply With Quote

Join the iLounge Community and the ad above will disappear.

Old 07-06-2008, 10:53 PM
#2
 
Veteran Lounger
 
S2_Mac's Avatar
 
Join Date: Oct 2006
Location: About 3 feet in front of the monitor
Posts: 4,878

There's got to be a better way of doing this....

iTunes' Applescript dictionary has no awareness of movie dimensions, so there's no quick way to get the info you want. And Image Events only reads still images, so it's of no help. That pretty much exhausts my meager knowledge;-)

(There's p'bly some hook in QuickTime that iTunes calls to get that info, but I've got no idea what it might be...maybe the folks at macscripting.net have a QT guru hanging around, or check with some QT groups....)

That said, this worked OK in the one simple test I gave it. It requires the QuickTime Player to open each movie file in a player window, then it grabs the dimensions, then it closes the player window/file; iTunes adds the dimensions to whatever info already exists in the track's Comments box.

This script is an accident waiting to happen -- drunk drivers do more error checking than this thing -- so treat it nicely (like, make sure you only select video files. Missing files will p'bly make it puke spectacular colors. Etc. ;-). Oh yeah -- don't have the iTunes display sorted by Comments!

Select a few files, activate the script, wait for a bit.
Code:
-- Movie Dimensions to Comments script
tell application "iTunes"
	set sel to the selection
	if sel is {} then display dialog "Please select something" buttons {"Cancel"}
	repeat with i from 1 to count of sel
		set the_track to item i of sel
		set the_alias to location of the_track as alias
		
		tell application "QuickTime Player"
			open the_alias
			set dims to dimensions of document 1 as list
			set width to item 1 of dims
			set height to item 2 of dims
			close document 1 saving no
		end tell
		
		set comments to comment of the_track
		set comment of the_track to (width & "x" & height & return & comments) as string
	end repeat
end tell
If you need info on how to save, use, or "install" the script, post again. (Sorry to be so brief; we had hurricane-force winds here on Wednesday, and I'm righteously pooped from spending what should have been a laid-back holiday doing serious clean-up ;-)
S2_Mac is offline  
Reply With Quote
Old 07-07-2008, 10:03 AM
#3
 
Freshman Lounger
 
Join Date: May 2006
Posts: 7

Dear S2_Mac,

This is more than I expected.
Your knowledge isn't meager at all!

It works like charm.
I'll be careful to treat it as you recommended.

I also have to thanks the extension of your post. You have provided me with the information I need to understand and run this script. Furthermore, you have made time to write the script for me.

My little knowledge allowed me to compile it and install it. Thanks for your offer in this regard too.

I hope bad weather goes away over there soon.

For anyone else interested in this iTunes Script, can find it here: Movie Dimensions to Comments

WARNING:
  • Read S2_Mac reply above.
  • Use only with movie (video) files.
  • Make sure the file(s) is (are) not "Missing" and it's (they're) actually in your library.
  • Make sure your video list is sorted by anything but "Comments" before proceeding with the script. (Do not sort by comments)


Demo


P.S.: I'm looking for a better (for free) place to host this script.
Any suggestion?
Thanks.

Last edited by MacDream; 07-07-2008 at 10:06 AM.
MacDream is offline  
Reply With Quote
Old 01-04-2013, 07:15 PM
#4
 
Freshman Lounger
 
Join Date: Jan 2013
Posts: 1

Will this script work with iTunes 11? I can't seem to access the link you provided. Could you upload it again please?

Thanks!
harrytipper is offline  
Reply With Quote
Old 01-04-2013, 08:45 PM
#5
 
Freshman Lounger
 
Join Date: May 2006
Posts: 7

I'm not using iTunes 11 until I can.
I'm using iTunes 10.7 and the script still works find, but since QT change to 10, I had to make a little change in the script and (keep) iTunes 7 in my application folder.

You have to check your inbox for links and examples because this crap site wont allow me to post links or images.

Give it a try in iTunes 11 with a test movie.
Good luck!
MacDream is offline  
Reply With Quote

Topic: Video Dimensions to Comments script help needed

Reply Thread Tools Topic Search

Become a member of the iLounge Forums. Register Now!
To start viewing messages, select the forum that you want to visit from the selection below.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:
Posting 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





View iLounge History. Read our old Forums Archive (2001-2003)
All times are GMT -4. The time now is 04:30 PM.


Shop for Accessories: Cases, speakers, chargers, etc.