Re: duplicate command
Re: duplicate command
- Subject: Re: duplicate command
- From: "koenig.yvan" <email@hidden>
- Date: Fri, 12 Apr 2013 19:04:33 +0200
Le 12/04/2013 à 18:31, Simon Topliss < email@hidden> a écrit : (path to desktop as text) & "get archives AppleScript - stripped.scpt" set sourcePath to quoted form of POSIX path of result "Macintosh HD:" set targetPath to quoted form of POSIX path of result
Here's a tip for those playing along at home…
Never, ever write code like the above. Always be explicit in your variable declarations. The correct way to write this is:
set sourcePath to quoted form of POSIX path of ((path to desktop as text) & "get archives AppleScript - stripped.scpt") set targetPath to "/"
Yvan's code is a bug waiting to happen.
May you explain better ?
result is an official property :
result
When a statement is executed, AppleScript stores the resulting value, if any, in the predefined property
result. The value remains there until another statement is executed that generates a value. Until a statement
that yields a result is executed, the value of result is undefined. You can examine the result in Script Editor
by looking in the Result pane of the script window.
Of course, I use its contents before any other instruction.
I do that for years and never got any problem related with this practice.
Yvan KOENIG (VALLAURIS, France) vendredi 12 avril 2013 19:04:04
|
_______________________________________________
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