Re: AppleScript and sysodsct (was: PDF fileType)

2001-03-02 Thread Dave Cragg

At 3:22 AM +0100 2/3/01, Sjoerd Op 't Land wrote:
OK, this worked. I'm now working on a library (in the Starter Kit, so I have
to keep it short) for setting and getting file attributes. For finishing I
need the AppleScript for setting file's attributes. I tried many things like
this:
   set name of alias "HD Sjoerd:Desktop Folder:testfile" to "ttt"
   set name of file "HD Sjoerd:Desktop Folder:testfile" to "ttt"

But I didn't succeed. The first one gave me: "Stack overflow." What does
that mean? And the second (translated) ""ttt" cannot be given to the name of
file "HD Sjoerd:Desktop Folder:testfile"".

Try this:

put "HD Sjoerd:Desktop Folder:testfile" into tPath
put "ttt" into tNewName
put "tell application "  quote  "Finder"  quote  " to set name of  file " \
  quote   tPath   quote   "to"  quote  tNewName  quote into tScript
send tScript to program "Finder" with "sysodsct"

However, I think you may be reaching some practical limits for this 
"sysodsct" approach.

The file information example I used before used AppleScript's 
built-in commands. But for any serious file management stuff, you'll 
need to use the Finder's own dictionary of commands and objects. But 
if you check the result of the above "send" command, you'll probably 
find it returns an error (even though it carries out the task). I get 
errors returned on any scripts sent  to the Finder that include tell 
application "Finder" as part of the script. I guess this is because 
you're asking the Finder to send appleEvents  to itself, and it 
doesn't like this. (Just guessing, though.)

Therefore, when you need to get the result from a Finder command, 
you're in trouble, because all you get is an error.

A workaround is to send the script to a different running application 
that handles appleEvents, but generally the Finder is the only 
application that can be guaranteed to be running. I discovered on my 
Mac that there is a process called "Folder Actions" that is always 
running, and sending the script to this process works.

E.g.
send tScript to program "Folder Actions" with "sysodsct"

But I've no idea whether "Folder Actions" runs on all Macs as a 
faceless process. If you save an empty AppleScript as an applet (with 
"Stay Open" checked), and then run that applet, you can then send 
scripts to it.

E.g.
send tScript to program "My Dead Applet" with "sysodsct"

However, if you're going to need another running application to which 
you can send scripts, it would probably be better to compile the 
scripts as an AppleScript applet to start with. And it would probably 
be faster too.

But all in all, I think the Externals Collection offers the best 
solutions for most situations.

Cheers
Dave Cragg

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: AppleScript and sysodsct (was: PDF fileType)

2001-03-02 Thread Sjoerd Op 't Land

My AppleScript/ MacFileAttribs library including explanation is ready. Check
it out at:

http://homepage.mac.com/sjoerdoptland/macfileattribs.mc

Dave Cragg wrote/ schreef:

 Try this:
 
 put "HD Sjoerd:Desktop Folder:testfile" into tPath
 put "ttt" into tNewName
 put "tell application "  quote  "Finder"  quote  " to set name of  file "
 \
  quote   tPath   quote   "to"  quote  tNewName  quote into tScript
 send tScript to program "Finder" with "sysodsct"
Thanks, it work like a charm.

Regards,
Sjoerd


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Launching browsers, again

2001-03-02 Thread Richard Gaskin

From time to time on this list, someone posts "How do I launch a browser
cross-platform", and some kind soul posts the latest script he's been using.

Interestingly, many of the scripts differ in regards to the registry entry
they check to get the path to the browser, and no matter which one I use it
seems that eventually I get some user who writes to me to say that his
browser doesn't launch.

Shouldn't there be a single registry entry that is the obvious best choice?
I know we're talking about MS here, but it seems odd that the confidence
about which call to make is relatively low.

And on the Mac, for similarly flakey reasons, the OS sometimes fails to
produce results unless everything is just so.

So here's da question:

What is the most reliable way to launch a browser to a given URL on both Mac
and Windows?

Also, what specific factors should we be looking at in the event that
Netscape or some other non-MS browser is installed as the default?



-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Multimedia Design and Development for Mac, Windows, UNIX, and the Web
 _
 [EMAIL PROTECTED] http://www.FourthWorld.com
 Tel: 323-225-3717   ICQ#60248349Fax: 323-225-0716



Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: Sockets vs. POST

2001-03-02 Thread AlainFarmer

 While working on some routines to send POST data to CGIs, I'm having some
 trouble getting the data in the right format...

What kind of trouble? 
Trouble with extracting the posted data ?
Trouble with the encoding of 8-bit ASCII chars ?

 1. Would it be any easier to take control over the whole transaction by
 using sockets instead of relying on MC's POST?  My first hunch is that it
 would not...

Your hunch is correct. Sockets are much more complicated because they are at a lower 
level of abstraction, e.g. more details to attend to than would normally be the case 
when the process is handled for you.

 ... but it's been a bear dealing with some CGIs.

I recommend you duke it out with the CGI protocol some more before giving up on this 
relatively easy protocol. Unless, of course, you have some very special protocol needs 
that CGI is not designed to handle or to handle-well. IOW, with sockets, you could 
create your own custom communication protocol. A protocol that doesn't have all of the 
un-necessary overhead of CGI, for example. You could conceivably create a protocol 
custom-made for MetaCard stacks to communicate via the Internet in their own 
native-tongue.

Just a random thought  ;-)

Alain Farmer
mailto:[EMAIL PROTECTED]
__
Get your own FREE, personal Netscape Webmail account today at 
http://webmail.netscape.com/

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: AppleScript and sysodsct (was: PDF fileType)

2001-03-02 Thread David Bovill

Now what would be real useful is to use this to set the "File Exchange"
preferences so the user wouldn't have to... Same for the Browsers and their
Mime types: Alain?


 From: "Sjoerd Op 't Land" [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Fri, 02 Mar 2001 18:37:14 +0100
 To: [EMAIL PROTECTED]
 Subject: Re: AppleScript and sysodsct (was: PDF fileType)
 
 My AppleScript/ MacFileAttribs library including explanation is ready. Check
 it out at:
 
 http://homepage.mac.com/sjoerdoptland/macfileattribs.mc
 
 Dave Cragg wrote/ schreef:
 
 Try this:
 
 put "HD Sjoerd:Desktop Folder:testfile" into tPath
 put "ttt" into tNewName
 put "tell application "  quote  "Finder"  quote  " to set name of  file "
 \
  quote   tPath   quote   "to"  quote  tNewName  quote into tScript
 send tScript to program "Finder" with "sysodsct"
 Thanks, it work like a charm.
 
 Regards,
 Sjoerd
 
 
 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.
 
 


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: Sockets vs. POST

2001-03-02 Thread Richard Gaskin

 While working on some routines to send POST data to CGIs, I'm having some
 trouble getting the data in the right format...
 
 What kind of trouble?
 Trouble with extracting the posted data ?
 Trouble with the encoding of 8-bit ASCII chars ?

Mostly that the server is reporting that the header contains invalid data.
Yesterday's error was that I'm missing a semicolon somewhere, but in
reviewing the Interarchy dump I can't find a semicolon present when I use a
browser that is not present when I make the same call from MC.  :(

 1. Would it be any easier to take control over the whole transaction by
 using sockets instead of relying on MC's POST?  My first hunch is that it
 would not...
 
 Your hunch is correct. Sockets are much more complicated because they are at a
 lower level of abstraction, e.g. more details to attend to than would normally
 be the case when the process is handled for you.

That's encouraging.  It seems silly to reproduce the whole protocol just
because of header errors.
 
 ... but it's been a bear dealing with some CGIs.
 
 I recommend you duke it out with the CGI protocol some more before giving up
 on this relatively easy protocol. Unless, of course, you have some very
 special protocol needs that CGI is not designed to handle or to handle-well.
 IOW, with sockets, you could create your own custom communication protocol. A
 protocol that doesn't have all of the un-necessary overhead of CGI, for
 example. You could conceivably create a protocol custom-made for MetaCard
 stacks to communicate via the Internet in their own native-tongue.

If only.   For this project I need to perform the same calls that a browser
makes, only from MC instead of a browser.

For all other projects, I'd love to use MC on the server side as well, but I
haven't found a shared hosting service that will let me do that.  If the
only alternative is to quintuple my hosting costs with colocation I'd rather
just continue using Perl.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Multimedia Design and Development for Mac, Windows, UNIX, and the Web
 _
 [EMAIL PROTECTED] http://www.FourthWorld.com
 Tel: 323-225-3717   ICQ#60248349Fax: 323-225-0716



Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




No Subject

2001-03-02 Thread miel



unsubscribe


Re: Sockets vs. POST

2001-03-02 Thread David Bovill

 From: Richard Gaskin [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Fri, 02 Mar 2001 12:44:10 -0800
 To: [EMAIL PROTECTED]
 Subject: Re: Sockets vs. POST
 
 What kind of trouble?
 Trouble with extracting the posted data ?
 Trouble with the encoding of 8-bit ASCII chars ?
 
 Mostly that the server is reporting that the header contains invalid data.
 Yesterday's error was that I'm missing a semicolon somewhere, but in
 reviewing the Interarchy dump I can't find a semicolon present when I use a
 browser that is not present when I make the same call from MC.  :(
 

What would be really nice is to have something which would analyse tow text
files and colourize the bits that differed. This is the sort of thing that
you need to do with matching genetic sequences, so I'm sure the algorithms
are out there (Xavier -:), but an nice scriptable app would be a boon.

Anyone know of one?

NB: five times the hosting costs for a dedicated server works out the same
price for 5 people if my maths is right. If you include me that leaves 3
more @ $20 a month. I remember reading this thing about those "freeways" in
the States, where everyone drives the same speed? Well in California
apparently they closed one of the lanes to everyone - save those cars with 4
or more people in them; worked a treat with those willing to share zipping
along - getting to work much faster. Any Californians out there?


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.