• 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: Finding and deleting specific extensions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding and deleting specific extensions


  • Subject: Re: Finding and deleting specific extensions
  • From: Henry L Miller Jr <email@hidden>
  • Date: Thu, 18 Sep 2003 14:21:45 -0600

I found this thread interesting, as I've been
tackling some of these issues myself recently.

What has stumped me to date, is how to have some
statements that access some properties of the
file class that ARE defined in OS X 10.2.6
Finder, but ARE NOT defined in Finder 9.1 remain
accessible when compiled on an OS X machine, and
be ignored at compilation time by an OS 9 machine.

In the tell block below, the properties "name
extension", "extension hidden", and "displayed
name" work well in OS X, but these properties are
not defined in OS 9. So, even though I don't try
to execute the commands accessing these
properties unless I'm in OS X 10.2.x, I can't run
the script on an OS 9 machine.

tell application "Finder"
-- get the path to source file
set srcPath to ((container of file srcFile) as string)

set versNum to (get the version) as number
-- get the displayed name, name
extension, and extension display condition in OS X
(*
need to find a way to "block"
these from compile process - OS 9 Finder complains
*)
if (versNum  10.2) then
set nameExt to name extension of file srcFile
set hiddenExt to extension hidden of file srcFile
set dispName to displayed name of file srcFile
end if -- {versNum}
end tell -- {Finder}


The purpose of this exercise is to have one
script that will operate on either platform (OS X
or OS 9) without having to edit the code and
comment in/out a block of text.

Any ideas?

Thanks,
Roy Miller
--
H. LeRoy Miller, Jr.
NOAA Aeronomy Laboratory

phone: 303-497-7209
email: email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Finding and deleting specific extensions
      • From: Christopher Nebel <email@hidden>
    • Re: Finding and deleting specific extensions
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: choose application list
  • Next by Date: Re: choose application list
  • Previous by thread: Re: choose application list
  • Next by thread: Re: Finding and deleting specific extensions
  • Index(es):
    • Date
    • Thread