• 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: Dumb Finder scripting question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dumb Finder scripting question


  • Subject: Re: Dumb Finder scripting question
  • From: "Mark J. Reed" <email@hidden>
  • Date: Fri, 14 Dec 2007 17:08:17 -0500

Thanks for the help.  I was mainly asking if there were a way to do it
without string munging, based on the fact that Finder items have a
"name extension" property, but since there's no "name without
extension" property, I guess not.



On 12/14/07, Laine Lee <email@hidden> wrote:
> On 12/14/07 1:17 PM, "Laine Lee" <email@hidden> wrote:
>
> > Or is that precisely what you're trying to avoid?
> Too vague a question perhaps. OK, then drag a few *.avi files onto a droplet
> created from the following script. If no corresponding *.mov file exists for
> any dropped file, an alert should appear.
>
> on open the_items
>     my check_related(the_items)
> end open
> on check_related(the_items)
> repeat with the_item in the_items
> set the_item to the_item as alias
> try
> tell application "Finder"
> set sost to ((container of the_item) as alias) as Unicode text
> end tell
> on error t1
> display dialog t1 and "
> Fooey!"
> end try
> set thesourcename to (name of (info for the_item))
> set thesourcename to (text items 1 thru -5 of thesourcename) as Unicode text
> tell application "Finder"
> set basename to thesourcename
> repeat
> try
> set name_target to alias (sost & thesourcename & ".mov")
> exit repeat
> on error friendly_error
> if friendly_error contains thesourcename then
> tell me to display dialog "There's no such item as" & space & "\"" &
> thesourcename & ".mov" & "\" in the folder of the dropped files."
> exit repeat
> else
> exit repeat
> end if
> end try
> end repeat
> end tell
> end repeat
> end check_related
>
>
> Laine Lee
>


--
Mark J. Reed <email@hidden>
 _______________________________________________
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: Dumb Finder scripting question
      • From: Laine Lee <email@hidden>
    • Re: Dumb Finder scripting question
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: Dumb Finder scripting question (From: "Laine Lee" <email@hidden>)

  • Prev by Date: Re: Opening the newest file in a folder
  • Next by Date: Re: Determine if a Word Document is New or Saved
  • Previous by thread: Re: Dumb Finder scripting question
  • Next by thread: Re: Dumb Finder scripting question
  • Index(es):
    • Date
    • Thread