Re: Converting MOD files
Re: Converting MOD files
- Subject: Re: Converting MOD files
- From: "Nigel Garvey" <email@hidden>
- Date: Sun, 13 May 2007 12:32:51 +0100
Michelle Steiner wrote on Fri, 11 May 2007 07:20:31 -0700:
>If all that this involves is changing the file extension, and not the
>data, this will do it.
>
>set foo to choose folder
>tell application "Finder"
> set bar to (files of foo whose name extension is "mod")
> try
> set bar to bar as alias list
> on error
> set bar to {bar as alias}
> end try
> repeat with foobar in bar
> if the extension hidden of foobar is false then
> set flag to false
> else
> set flag to true
> end if
> set the extension hidden of foobar to true
> set the name of foobar to the displayed name of foobar & ".dv"
> if flag is false then set the extension hidden of foobar to false
> end repeat
>end tell
Hi, Michelle.
The above only works properly if "Show all file extensions" is left
unchecked in the Finder's "Advanced" preference pane. Otherwise the ".dv"
will simply be tacked on after the ".mod".
A more reliable and less file-intensive approach would be:
set foo to (choose folder)
tell application "Finder"
set bar to (name of files of foo)
repeat with foobar in bar
if (foobar ends with ".mod") then set the name of file foobar of
foo to text 1 thru -5 of foobar & ".dv"
end repeat
end tell
NG
_______________________________________________
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