Broken scripts in Panther
Broken scripts in Panther
- Subject: Broken scripts in Panther
- From: Mr Tea <email@hidden>
- Date: Mon, 08 Dec 2003 16:11:10 +0000
In Jaguar I used a script (adapted from something posted here by John
Delacour) to save the contents of Safari's front window to the desktop.
After extracting a sensible file name from the page's title and writing it
to the variable 'n', the script went on like this...
set f to POSIX path of ("" & (path to desktop) & n & ".html")
tell application "Safari" to save front document in f as text
After installing Panther, the pages were still saved, but not to the
desktop. Instead, the files were saved at the root level of the startup
disk, and the path to the desktop, in slash delimited form, was included as
part of the file name. Messy.
Fortunately, the problem was easily resolved by adding another line:
set f to POSIX path of ("" & (path to desktop) & n & ".html")
set f to POSIX file f
tell application "Safari" to save front document in f as text
...but why did the original version stop working?
This seems to be part of a process that has been going on over the past few
years, whereby AppleScript has (IMO) become progressively less willing to
make assumptions and perform coercions on the part of the user. While this
allows experienced scripters to script with greater precision (perhaps), it
also makes applescript more like machine code, less 'english-like', and less
forgiving for the casual/inexperienced user. As a hobbyist scripter who
works mainly by trial and error, I find this a mixed blessing.
Nick
pp Mr Tea
--
"One learns scripting and programming by a thousand
errors." J. Delacour
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.