Re: AppleScripts that I have come to love no longer work
Re: AppleScripts that I have come to love no longer work
- Subject: Re: AppleScripts that I have come to love no longer work
- From: Nigel Garvey <email@hidden>
- Date: Sun, 23 Feb 2014 13:18:38 +0000
2551 wrote on Sun, 23 Feb 2014 16:22:36 +0700:
>(*
>Trim File Names -- Modified for Mavericks
>
>This script is designed to trim the name of specific folders in the
front
>window of the desktop.
>If no folder windows are open, the script will affect folders on the
>desktop.
>
>Copyright © 2001–2007 Apple Inc.
>
>You may incorporate this Apple sample code into your program(s) without
>restriction. This Apple sample code has been provided "AS IS" and the
>responsibility for its operation is yours. You are not permitted to
>redistribute this Apple sample code as "Apple sample code" after having
>made changes. If you're going to redistribute the code, we require
>that you make it clear that the code was descended from Apple sample
>code, but that you've made changes.
>*)
[snip]
> display dialog "Text to trim from every file name:" default answer ""
>buttons {"Cancel", "Trim Start", "Trim End"}
> copy the result as list to {button_pressed, text_to_trim}
Did Apple really distribute a script containing this abomination?!
Never assume that items in a list coerced from a record will be in a
particular order. Always set your variables directly from the record's
properties:
display dialog "Text to trim from every file name:" default answer "" buttons {"Cancel", "Trim Start", "Trim End"}
set {button_pressed, text_to_trim} to {button returned, text returned} of result
Or:
display dialog "Text to trim from every file name:" default answer "" buttons {"Cancel", "Trim Start", "Trim End"}
set {button returned:button_pressed, text returned:text_to_trim} to result
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