Re: Disappearing applescript
Re: Disappearing applescript
- Subject: Re: Disappearing applescript
- From: MoneyMan <email@hidden>
- Date: Mon, 8 Jan 2001 08:36:54 -0800
I too am having trouble using Applescript lately. I'm using a beige
G3 w/ OS 9.04, OSA Menu 1.22 and Applescript 1.4 (automatically
updated by Software Update). My scripts aren't disappearing but I've
been having trouble running some URL Access scripts (for uploading to
ftp server), especially when launched by OSA Menu. I've been getting
error messages and sometimes my finder will crash. Also, I'm not sure
if it's related but I've noticed when I open some of my scripts in
Script Editor some of the syntax changes. Example:
tell application "BBEdit 6.0"
set the_list to ""
+event R*chGoto; 1
repeat while (find "<a href.*<br>" with +class Grep;)
set found_text to +class stxt; of window 1
set the_list to the_list & found_text & return
end repeat
Notice all the NEW syntax in double chevrons like +event R*chGoto;.
Do I have a bad version of Applescript or could it be some other
system component? Where can I get a new version of Applescript or URL
Access Scripting if they're bad or damaged?
thanks in advance,
JD
>
Send applescript-users mailing list submissions to
>
email@hidden
>
>
To subscribe or unsubscribe via the World Wide Web, visit
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
or, via email, send a message with subject or body 'help' to
>
email@hidden
>
>
You can reach the person managing the list at
>
email@hidden
>
>
When replying, please edit your Subject line so it is more specific
>
than "Re: Contents of applescript-users digest..."
>
>
>
Today's Topics:
>
>
1. RE: Scripting Acrobat Distiller (email@hidden)
>
2. Re: Sunday, Bloody Sunday (final report) (Richard 23)
>
3. Disappearing applescript (Glenn McNolty)
>
4. Re: Internet Explorer (GetSource) R23 consistently Returns
>
Rants (Richard 23)
>
5. Re: Web authoring tools (Peter Fine)
>
6. Re: Reading Lists and Records from Disk Files (Richard 23)
>
7. Re: Web authoring tools (Richard 23)
>
8. Re: if, idle, stay open (again, sorry) (cris)
>
9. Re: Disappearing applescript (John W Baxter)
>
10. How to implement "Save As" function for text editor?
>
(=?BIG5?B?Uk9CSU4uSEFOIMH6pK+0vA==?=)
>
11. Re: if, idle, stay open - PROVE IT (John W Baxter)
>
>
--__--__--
>
>
Message: 1
>
From: email@hidden
>
To: email@hidden, email@hidden
>
Subject: RE: Scripting Acrobat Distiller
>
Date: Sun, 7 Jan 2001 15:59:10 -0500
>
>
The example givien at the Adobe developers web site is all one line within
>
a tell:
>
>
open "report.ps" destination "myreport.pdf" joboptions "Macintosh
>
HD:Applications:Adobe Acrobat
>
4.0:Distiller:Settings:ScreenOptimized.joboptions" openpassword "MyPassword"
>
changepassword "MyPassword" with wait without printing
>
>
This, unfortunately, requires that you open and process a file.
>
>
My work around to this is inadequate: I know that the selected job option
>
when closing Distiller is the default job option when it opens again.
>
Another work around is to remove all other options from the Settings folder
>
so only the one you need is available. These are fine if you only need one
>
option, and your script is used on only one machine.
>
>
This shortfall in scripting language also prevents us from creating a
>
watched folder within a script. I can create it, but can't tell Distiller to
>
watch it.
>
>
-----Original Message-----
>
From: Pascal Debaisieux
>
To: email@hidden
>
Sent: 1/5/01 9:41 AM
>
Subject: Scripting Acrobat Distiller
>
>
Hello,
>
>
By an applescript, I would like to start Acrobat Distiller WITH a
>
specific joboptions file ( the file which contains the settings for the
>
PDF ). Does anybody knows the exact syntax for that functionality.
>
Thanks.
>
Pascal.
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
>
--__--__--
>
>
Message: 2
>
Subject: Re: Sunday, Bloody Sunday (final report)
>
Date: Sun, 7 Jan 2001 13:32:21 -0800
>
From: Richard 23 <email@hidden>
>
To: "\"AppleScript Users\" <"<email@hidden>
>
>
I have fixed the mid-line warning message I mentioned in my
>
last post. Now the example script posted earlier compiles
>
just fine with the Warning_Flag set to true.
>
>
If you're one of the 3 sneaky people who downloaded while
>
the file was still cooling off (creation date prior to
>
1:08 PM PST, probably timezone doesn't matter) you might
>
want to go back and get the one I just uploaded.
>
>
The other one will work but you may have to edit by hand
>
to remove any warnings that come after a continuation
>
character. This version is now sewn up. Any further
>
changes will bump up the version number.
>
>
Here's hoping we can usher in a brief period of clarity
>
on the list (hey I should write ad copy).
>
>
So last shameless plug for now.
>
Sit back, relax, kick off your pants, and go one step beyond.
>
>
<http://homepage.mac.com/richard23/>
>
>
and send me those bug reports (god forbid).
>
>
R23
>
>
--__--__--
>
>
Message: 3
>
Date: Mon, 8 Jan 2001 09:09:52 +1100
>
To: email@hidden
>
From: Glenn McNolty <email@hidden>
>
Subject: Disappearing applescript
>
>
Dear all,
>
I have a problem with Applescript on my G4-400. I have come across a
>
problem that whenever I alter or create a new applescript the next
>
time I open it in Script Editor the code is just gone. Like I open it
>
to a compeletly blank screen.
>
>
I have upgraded recently to the latest version of Applescript and I
>
have installed the Smile editor as well. Might either one of these
>
things be part o the cause.
>
>
Any help appreciated.
>
>
Cheers Glenn
>
--
>
-----------------------------------------------------
>
Glenn McNolty
>
Senior Multimedia Producer
>
Interactive Media Group
>
Learning Services
>
Woolstores Campus
>
Deakin University Ph : (03) 5227 8184(Wk)
>
Geelong Vic. 3217 (03) 5227 8177(fax)
>
AUSTRALIA
>
>
WEB http://www2.deakin.edu.au/DCAD
>
E-MAIL email@hidden
>
-----------------------------------------------------
>
>
--__--__--
>
>
Message: 4
>
Subject: Re: Internet Explorer (GetSource) R23 consistently Returns
>
Rants
>
Date: Sun, 7 Jan 2001 14:28:28 -0800
>
From: Richard 23 <email@hidden>
>
To: <email@hidden>
>
>
>IE's window indexing methodology is a bit funny. You'd expect window 1 to
>
>*be* window 1; quite the contrary - run ListWindows and see.
>
>
You think that's funny? I've been giggling for weeks!
>
>
An error occurs in an external js file (linked in the head, pretty
>
standard).
>
The file indicated is the html file. Click the source button and yep, it
>
shows the html source and hilights a section which is unrelated to both
>
the
>
error and the line number. Ok fine. Open the js file and reference the
>
line
>
number. It has nothing to do with the error.
>
>
I tried placing my site's main window in one big frame so the JavaScript
>
and associated objects (preloaded images, obects containing file info,
>
etc)
>
and when I click on a link to go to another page, the page starts to load
>
and a "Permission denied" dialog pops up.
>
>
I look on MicroSoft's site. No match for a search on that error message.
>
I find a list of script errors for JSCRIPT. Great! It's merely a table
>
listing the errors with no info and no links to more information. My
>
error's listed there so there's hope. I find a page for runtime and
>
(compilation? don't remember the other one) errors. Looks good, there's
>
some detail about every error message listed. But go figure mine isn't
>
there.
>
>
Fiddling around with a select form element (popup list) I discover to my
>
chagrin I have to make a special test case. When a popup list has several
>
items in it the first element is item 0 (normal, JavaScript arrays start
>
at 0) but with a single item I get an error. On closer inspection it
>
appears that single item select elements place the first item at index
>
1. Adding another shifts it to 0 where it should have been in the first
>
place.
>
>
JSCRIPT has brought me hours of misery. Thank MicroSoft, for once again
>
taking someone else's product, pretty much reshaping it in your image,
>
just different enough to break scripts not written exclusively for your
>
product, and bully everyone else out of your way so you become the de
>
facto
>
standard. Since most people wouldn't know how to install another browser
>
to save their life, I'm surprised your market share isn't even larger.
>
>
And the browser wars have done nothing to improve platform independency.
>
Thanks a lot. I know where you should go today.
>
>
Oh, but the DOM you've implemented does show a lot of promise. Here's
>
hoping you begin to follow the standards you help fund and have ignored
>
in the past. Since you obviously are going to be the market leader for
>
the next few centuries anyway I hope we can expect you at least try to
>
make your product a little easier for those who have to support it once
>
you've managed to kill off the rest of your competition. Good luck!
>
>
R23
>
>
--__--__--
>
>
Message: 5
>
Date: Sun, 07 Jan 2001 17:37:03 -0500
>
Subject: Re: Web authoring tools
>
From: Peter Fine <email@hidden>
>
To: AppleScript-Users <email@hidden>
>
>
on 1/7/01 1:53 PM, Max Bonilla at email@hidden wrote:
>
>
> More than anything,
>
> this is a learning exercise. So I'm now looking for a web authoring
>
> tool that is scriptable, easy to use, and inexpensive.
>
>
Max,
>
>
Easy to use is in the eye of the beholder. For scriptable and inexpensive
>
(and easy to use IMHO), try PageSpinner. <http://www.optima-system.com>
>
>
Peter
>
>
--__--__--
>
>
Message: 6
>
Subject: Re: Reading Lists and Records from Disk Files
>
Date: Sun, 7 Jan 2001 14:42:40 -0800
>
From: Richard 23 <email@hidden>
>
To: <email@hidden>
>
>
>Hello Richard, in the past i tried to use the same method but it didn't
work
>
>correctly. I don't remember the exact errors but one of the problems was
>
>that the prefs file obvious contained the whole parent script (about 250
>
>Kb).
>
>
Hi cris.
>
>
I'd be interested to see what you did that didn't work if you wanted
>
to send me something offline. At any rate at least you have a working
>
example that will encourage you to try again. I'll bet the parent
>
property inserted into that script you mention would work better than
>
dexatrim to slim down that file...
>
>
>Your example works very well, but it makes no difference if i remove the
>
>line:
>
>property parent : AppleScript
>
>
>
>No matter how large i make the parent script, the resulting prefs file has
>
>always the same size, so it seems the parent is never saved in your
>
>example!?
>
>
It will under the right conditions. Being that it was such a simple
>
example makes it less than a real-world script where any number of
>
factors can contribute to the result.
>
>
I'll file away that nugget of info that in this case...no bloat.
>
>
But most likely it's due to one or more of these:
>
>
1. No variables are referenced which are properties of the parent.
>
2. The script object itself was generated within a handler and its
>
scope ends there. In fact the script object is generated every
>
time the handler is called and no part of it persists.
>
3. Ths script object was not in the top level where I believe the
>
one where I first noted the bloat occurred.
>
>
Someone who knows about this ought to speak up!
>
>
I wonder how much of the parent is sucked into a script object saved
>
with store script. Is is all or nothing? Or can subsets of the parent
>
be stored, if the child makes references to one or more of the parent's
>
properties and those properties have no further dependencies.
>
>
And why can't I load a script object inline, that is have a script
>
object function in the same scope as a similar one which was originally
>
part of the script. No matter what I seem to do it always takes a
>
hurculean effort which makes me less than anxious to try again.
>
>
If any "experts" on script objects (if there are any) would like to
>
spend a little time explaining this, perhaps offline I would really
>
like to get a handle on this. I've got tons of library files just
>
waiting for a reliable system. Mine's nearly there but still too
>
inconvenient to hassle with most of the time. Cut and paste is no
>
way to script.
>
>
R23
>
>
--__--__--
>
>
Message: 7
>
Subject: Re: Web authoring tools
>
Date: Sun, 7 Jan 2001 15:00:38 -0800
>
From: Richard 23 <email@hidden>
>
To: <email@hidden>
>
>
>I am now beginning to think about using AppleScript to create a small
>
>web page, which I hope to develop over time. More than anything,
>
>this is a learning exercise. So I'm now looking for a web authoring
>
>tool that is scriptable, easy to use, and inexpensive. My goal is to
>
>create a web page that is updated automatically with text and a few
>
>simple pictures. No fancy animations or anything like that, for now
>
>;-).
>
>
I probably should shut up soon because this is not my forum exclusively
>
but it's a slow day... 8)
>
>
In my opinion you're better off getting a good book, checking out the
>
html spec at <http://www.w3.com/> and start out crafting your pages
>
by hand.
>
>
You'd think the wysiwyg (what you see is what you get) html editors if
>
nothing else would be a good learning tool and that they'd save you a
>
lot of time in the long run. I started out thinking that way.
>
>
But those things tend to spit out a lot of extra empty tags and garbage
>
that slow down page loading, often use little tricks which aren't
>
compliant
>
and aren't cross-browser. The pages are harder to edit and you end up
>
spending a lot of time cleaning them up. Often if you open up a page
>
you've finetuned they reformat and add a lot of garbage again.
>
>
I know my site's not the "bomb" but it was all written by hand although
>
I have written some AppleScripts to help me write clean compliant code
>
and I'll put some of that kind of info on my site (someday).
>
>
One strong point of the last version of Adobe GoLive (4.0) was the very
>
capable JavaScript editor but I tend to use BBEdit or Alpha now.
>
>
Also if you do it yourself you'll learn a lot more and will actually
>
understand your pages which is important if you want to support them
>
over time.
>
>
One tool I would recommend is HtmlTidy by Dave Raggett (one of the big
>
boys, he's the principal editor of the latest HTML spec
>
>
<http://www.w3.org/TR/1999/REC-html401-19991224>
>
>
HtmlTidy is available at:
>
>
<http://www.w3.org/People/Raggett/tidy/>
>
>
It can help filter out the garbage created by one of those loud and
>
lousy editors as well as tell you where you went wrong (element
>
not closed, incorrect tag name, etc) and a lot of little things that
>
can be useful.
>
>
Whatever you do, don't be suckered into writing pages that cater to a
>
specific browser. Both of the big ones are pretty awful when it comes
>
to standards but falling into the trap that led to those "Best when
>
viewed with" or "optimized for" labels. Try to make your pages as
>
accessible as you can. The Mac and PC are not the only computers on
>
the web. Far from it.
>
>
That's my general advice for anyone who would like to start up a
>
little homebrew site. But I'm one to talk. I've got ugliest site
>
this side of the pecos. But it keeps me off the street.
>
>
Let me know if you would like some general help.
>
>
--__--__--
>
>
Message: 8
>
Date: Mon, 08 Jan 2001 01:25:16 +0100
>
Subject: Re: if, idle, stay open (again, sorry)
>
From: cris <email@hidden>
>
To: AppleScript Users <email@hidden>
>
>
on 07.01.2001 21:41 Uhr, email@hidden at email@hidden wrote:
>
>
[Description for a workaround for the idle-if-crash bug]
>
>
>
> BTW, I'm running OS 8.6 and AppleScript 1.3.7... Jim
>
Your problem had likely another reason if you experienced it under AS 1.3.7.
>
Using AS 1.3.7 _is the solution_ for the idle-if-crashes on AS 1.4.x.
>
>
>
Greetings
>
cris
>
>
--__--__--
>
>
Message: 9
>
Date: Sun, 7 Jan 2001 17:43:06 -0800
>
To: Glenn McNolty <email@hidden>,
>
email@hidden
>
From: John W Baxter <email@hidden>
>
Subject: Re: Disappearing applescript
>
>
At 9:09 +1100 1/8/01, Glenn McNolty wrote:
>
>I have a problem with Applescript on my G4-400. I have come across a
>
>problem that whenever I alter or create a new applescript the next
>
>time I open it in Script Editor the code is just gone. Like I open it
>
>to a compeletly blank screen.
>
>
>
>I have upgraded recently to the latest version of Applescript and I
>
>have installed the Smile editor as well. Might either one of these
>
>things be part o the cause.
>
>
The really latest, currently-posted version of AppleScript should be OK.
>
If you upgraded to an International English AppleScript which was
>
downloaded some time ago, or came with at least some of the CDs in new
>
machine, you got a version which behaves as you describe. [Unfortunately,
>
in Apple's infinite wisdom, the bad version and the good version have the
>
same version numbers.]
>
>
--John
>
--
>
John Baxter email@hidden Port Ludlow, WA, USA
>
>
--__--__--
>
>
Message: 10
>
From: =?BIG5?B?Uk9CSU4uSEFOIMH6pK+0vA==?= <email@hidden>
>
To: "'email@hidden'"<email@hidden.
>
com>
>
Subject: How to implement "Save As" function for text editor?
>
Date: Mon, 8 Jan 2001 09:02:28 +0800
>
>
Hi,
>
>
I am trying to implement a script which could save files for most text
>
editors.
>
I found that some text editors can accept the commands of AS, but others
>
can't.
>
For example, the AppleWorks can, but the SimpleText, BBEdit and MS-Word
>
can't.
>
I don't know what makes the result different.
>
Is there any one can tell me why?
>
Or is there any solution for this issue?
>
Thanks.
>
>
Robin
>
>
--__--__--
>
>
Message: 11
>
Date: Sun, 7 Jan 2001 21:08:53 -0800
>
To: email@hidden
>
From: John W Baxter <email@hidden>
>
Subject: Re: if, idle, stay open - PROVE IT
>
Cc: email@hidden
>
>
I ran the script below for just under 3 hours on Mac OS 9.0.4, with two IE
>
5 windows open...each of them arranged to refresh their pages periodically.
>
>
Specifically:
>
>
http://traffic.wsdot.wa.gov/hoodcanal/livefram.htm?
>
(each of two frames updates every 30 seconds)
>
>
http://www.wsdot.wa.gov/ferries/commuter_updates/vesselwatch/index.cfm/vesse
lwatch_ind/4
>
>
I went to the store leaving the Hood Canal Bridge window as the front
>
window in IE, and the applet in front.
>
>
Toward the end of the three hours, I messed about with which window was in
>
front. The applet continued to use processor time.
>
>
Then I ran another AppleScript script (application, run from a folder in
>
the Apple Menu Options folder) to open a Finder window I wanted to work on.
>
Almost immediately, Finder froze.
>
>
--John
>
>
>
At 23:30 -0700 1/6/01, Donald S. Hall wrote:
>
>Try the following test script on OS 9.0.4. For me this crashes in about 15
>
>minutes with IE5.0 running, faster, it seems, if IE has more than one
window
>
>open. Doesn't matter if it is saved as a classic applet or a Mac OS X
applet:
>
>
>
>property checkInterval : 30 -- check for new action times every this many
>
>seconds
>
>global today -- day of the week of today as a string
>
>
>
>on run
>
> beep 2
>
> set today to word 1 of date string of (current date)
>
> set theList to {{"test item", (current date) + 1 * days}}
>
>end run
>
>
>
>-- idle handler ---------------------------------------------------------
>
>-- runs every checkInterval seconds
>
>on idle
>
> copy today to previousToday
>
> --set today to word 1 of date string of (current date)
>
> set today to (current date)
>
> checkTheList() -- is it time to take action?
>
> return checkInterval -- run this handler again after this many
>
>seconds have
>
>passed
>
>end idle
>
>
>
>-- check to see if an action time has passed -----------------------------
>
>to checkTheList()
>
> --do stuff
>
>end checkTheList
>
>
>
>On Friday, January 5, 2001, at 05:38 PM,
>
>email@hidden wrote:
>
>
>
>I REALLY need some empirical evidence of this, as ALL of my scripts
>
>with idle handlers have if statements and I've had exactly 1 crash
>
>that wasn't due to my own bad code.
>
>
>
>(I add tasks to a list and then idle through that list in order
>
>to allow the server to continue working while the script progresses)
>
>
>
>My experience makes me want to decry this as a rumor, but it's so
>
>persistently brought up I feel compelled to give it some credence...
>
>
>
>Is there a test case script out there that succintly demonstrates this
crash?
>
>
>
>Is there a timeframe over which these suppossed crashes do not occur?
>
>(As I'm not seeing it in the 2-12 hours runs I use...)
>
>
>
>~Phi
>
>_______________________________________________
>
>applescript-users mailing list
>
>email@hidden
>
>http://www.lists.apple.com/mailman/listinfo/applescript-users
>
>
--
>
John Baxter email@hidden Port Ludlow, WA, USA
>
>
>
--__--__--
>
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
>
>
End of applescript-users Digest