• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Unable to deal with audio file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unable to deal with audio file


  • Subject: Unable to deal with audio file
  • From: Emile SCHWARZ <email@hidden>
  • Date: Mon, 3 Nov 2008 21:09:48 +0100 (CET)

Hi all,

the following script gives an error at the line <set AnAudioItem to audio file AnAudioItem>

It is an adaptation of a working (bur very large) script who do many other things.

tell application "Finder"
	-- The front window holds many (and only) mp3 files
	set fw to front window
	set AnAudioItem to item 1 of fw

	-- TI stands for… name extension! [I wanted to use UTI, but wasn't able to…]
	set TI to name extension of AnAudioItem

	if TI is "mp3" then -- avoid non mp3 file
		tell application "System Events"
			-- Try to convert AnAudioItem to an audio file reference
			set AnAudioItem to audio file AnAudioItem
		end tell
	end if

	return properties of AnAudioItem
end tell

the error message is (translated from French):
AppleScript Error
Unable to translate «class docf» <AppleScript path of the mp3 file>
in the awaiting type.


I also want to get the “kbs” value from the file, but I do not understand how to do that; the dictionary is not crystal clear for my current english knowledge.

Help wanted (welcome to send them),

Emile


PS: System Events.sdef is not very prolix nor explicit for this matters.

What I want to do is to make a simpple report on each audio file: name, size, duration, bps to be able (later) to compare similar songs (duplicate) and trash any real duplicate / trash less quality (kbs) file(s).

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Unable to deal with audio file
      • From: Luther Fuller <email@hidden>
  • Prev by Date: Re: Print to PDF work flow
  • Next by Date: Re: Unable to deal with audio file
  • Previous by thread: Re: Install in Dock
  • Next by thread: Re: Unable to deal with audio file
  • Index(es):
    • Date
    • Thread