• 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
Re: Converting MOD files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Converting MOD files
      • From: Peter Baxter <email@hidden>
  • Prev by Date: difficulty with list filtering
  • Next by Date: Java program called within applescript
  • Previous by thread: Re: Converting MOD files
  • Next by thread: Re: Converting MOD files
  • Index(es):
    • Date
    • Thread