Re: Dumb Finder scripting question
Re: Dumb Finder scripting question
- Subject: Re: Dumb Finder scripting question
- From: KOENIG Yvan <email@hidden>
- Date: Sun, 16 Dec 2007 18:32:52 +0100
Hello
I will give my two cents.
Here is a slightly modified code using a handler which make no
assumption about the available extension.
I know that int this case the original fileName ends with ".AVI" but
it may be interesting to have a "more general" handler.
if (count of toConvert) > 0 then
tell application "QuickTime Player"
repeat with aviURL in toConvert
set doc to first item of (open location aviURL)
set pathName to (get path of doc) as text
set {movPath, movName} to my change_Path_Name(pathName, ".mov")
save self contained doc in POSIX file movPath
close document movName
end repeat
end tell
end if
on change_Path_Name(p, x)
set pa to p as alias
tell application "Finder"
set f to (get name of pa) as text
set e to (get name extension of pa) as text
if e = "" then
set mp to p & x
set mn to f & x
else
set mp to (text 1 through (-2 - (count of e)) of p) & x
set mn to (text 1 through (-2 - (count of e)) of f) & x
end if
end tell
return {mp, mn}
end change_Path_Name
Yvan KOENIG
_______________________________________________
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