Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Applescript Question

Applescript Question
Thread Tools
Fresh-Faced Recruit
Join Date: May 2001
Location: SouthBank, Victoria, Australia
Status: Offline
Reply With Quote
Aug 1, 2001, 03:51 AM
 
I was wondering if its possible to do Applescript code that processes web pages/talks to DBs (Databases) for DB driven site?...

I've been coding for quite a while now, have experince in quite a few programming languages (apart from Applescript), and wish to do server side scripting using Applescript...

Reason:

- its free, (Not that Java isn't but Java Applets s*ck and you still have to pay quite alot for Java (J2EE)based server for any platform!
- comes preinstalled on Most Macs,
- don't have to worry about Memory management (I hope)
- even though there are better programming languages (C/C++), which I know... I think this is too extreme for CGI type interfacing with web especially what I want it to do...

First of all, I currently work for a web company,...Atomic Media (Note our web site is sucky but I didn't do anything (code or otherwise with it)!. Work on PC, plan to update my home PPC/8100 to G4 status soon, and wish to port over code which I created at work using a Web Development Tool created by Allarie software. The tool is similar to that of the spectra application done by the guys at Allarie..., but without the cost! Its still in its infancy, has some cool features like logging,access rights, file locking, and is totally DB driven...

Code HTML/with embedded ColdFusion logic for processing data (This is what I want to port over seeing HTML will stay the same)

This would be a great feature to have on the Mac seeing that Allaire don't plan to port their tools across to the Mac platform... and wish to make it available for free for Mac user(s) to update dynamic web content. Especially if its companies doing intranet stuff, internet stuff may be a little difficult seeing that the ISP has to run the show, but may be of use if the user has Mac based ISP. With minor code nessacery for modules that they will require... a totally pluggable module administration setup without web dev cost only plugin cost if any at that!

Anyways is this possible through Applescript? If so can you direct me to any sites that have this type of functionality, and also if its possible to make it DB() driven... Any Database restrictions, like portablity, avalibility, driver support and so on will also be useful


cheers
tibs

[ 08-01-2001: Message edited by: my7200 ]
"We are what we repeatedly do. Excellence then, is not an act, but a habit." Aristotle
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Aug 5, 2001, 03:18 PM
 
There's a couple of ways of doing what you want, but almost certainly won't offer drag-and-drop replacement of your existing pages.

First of all, you can use AppleScript for any cgi-type processor. There's various AppleScript Additions around which can help with decoding URLs passed in from links. Your AppleScript cgis can do anything a normal AppleScript can do, including link to databases, etc. http://www.webstar.com/exws/development.html#scripting has a couple of pointers on writing AppleScript-based .cgis.

Also, you can use SSI (Server Side Includes) to call an AppleScript program and have the results embedded in your page before it's returned to the user. Something like: <font face = "courier">&lt;!--#exec cgi="/cgi-bin/somescript"--&gt;</font> will execute the somescript script and insert the returned data in its place.

There used to be a product around that let you write AppleScript code directly into the page and have that execute when the page was served (similar to how .jsp, .asp, and various integration products like Lasso and ColdFusion work), but I don't remember what it was called, and can't find any links to it. If you can find it, this would be the most seamless way of AppleScripting your site... simply replace the Allaire tags with AppleScript code that does the same thing.

Your simplest solution, however, might be to not reinvent the wheel. Something like BlueWorld's Lasso, which is a complete database integration system. It comes in two flavors, a FileMaker Pro and an ODBC version. ODBC will let you connect to any ODBC-compliant database including Access, Oracle, mySQL, SQL Server, etc. Maxum also offer several dynamic content products for forms processing and dynamic content generation.

Then, of course, there's the venerable PHP and mySQL packages that let you build dynamic content using the PHP language. PHP is growing quickly and has the advantage that it's free.

If you are going the AppleScript route, check out the resources on places like ScriptWeb and AppleScriptSourceBook from Bill Cheeseman. Finally, it's worth checking out some of the links on extending WebStar. While some of them relate to WebSTAR specifically, many of the products listed and techniques can be applied to other web servers.

Good Luck
Gods don't kill people - people with Gods kill people.
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Aug 5, 2001, 03:26 PM
 
Now that you've got me thinking, I found the AppleScript product I couldn't recall before.

OpenScript is a WebSTAR-compatible plug-in that lets you write AppleScript directly in a web page using the form:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>&lt;BODY&gt;
[Regular HTML]
&lt;AppleScript&gt; [AppleScript code]&lt;/AppleScript&gt;
[more HTML]
&lt;/BODY&gt;
&lt;/HTML&gt;</font>[/code]

That might just be the product you're looking for.

Thanks To Bill Cheeseman's AppleScriptSourceBook site for the link.

[ 08-05-2001: Message edited by: Camelot ]
Gods don't kill people - people with Gods kill people.
     
my7200  (op)
Fresh-Faced Recruit
Join Date: May 2001
Location: SouthBank, Victoria, Australia
Status: Offline
Reply With Quote
Aug 5, 2001, 05:49 PM
 
Originally posted by Camelot:
<STRONG>Now that you've got me thinking, I found the AppleScript product I couldn't recall before.

OpenScript is a WebSTAR-compatible plug-in that lets you write AppleScript directly in a web page using the form:
&lt;BLOCKQUOTE&gt;&lt;font size="1"face="Geneva, Verdana, Arial"&gt;code:&lt;/font&gt;&lt;HR&gt;&lt;pre&gt;& amp;lt;font size=1 face=courier&gt;&lt;BODY&gt;
[Regular HTML]
&lt;AppleScript&gt; [AppleScript code]&lt;/AppleScript&gt;
[more HTML]
&lt;/BODY&gt;
&lt;/HTML&gt;&lt;/font&gt;&lt;/pre&gt;&lt;HR&gt;&lt;/BLOCKQUOTE&gt;

That might just be the product you're looking for.

Thanks To Bill Cheeseman's AppleScriptSourceBook site for the link.

[ 08-05-2001: Message edited by: Camelot ]</STRONG>

Thanks for the AppleScript insight... I better start experimenting:-)...

cheers
"We are what we repeatedly do. Excellence then, is not an act, but a habit." Aristotle
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:09 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2