Re: Dumb Finder scripting question
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