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: "koenig.yvan" <email@hidden>
- Date: Sun, 23 Feb 2014 14:53:55 +0100
Le 23/02/2014 à 14:18, Nigel Garvey <email@hidden> a écrit :
> 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
Hello Nigel
I retrieved the scripts on my daughter's old iBook.
I'm sure that it was never edited because :
(1) creation and modification dates are 2005/03/21
(2) my daughter ignore all about AppleScript.
The awful instructions coercing a record into a list are really embedded in them.
Now I understand why this abomination is so often used.
Yvan KOENIG (VALLAURIS, France) dimanche 23 février 2014 14:53:49
_______________________________________________
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