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 > What if i want to make an HTML doc?

What if i want to make an HTML doc?
Thread Tools
Nebagakid
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status: Offline
Reply With Quote
Oct 8, 2000, 01:21 PM
 
What if i want to make an HTML doc using variables set in a Script? Is is possible? or no? is it?

------------------
CLOWNS!!!!!!!!!!!!!!!!!!!
     
MacCanada
Junior Member
Join Date: Oct 1999
Location: Edmonton, Alberta, Canada
Status: Offline
Reply With Quote
Oct 10, 2000, 09:15 AM
 
yes it is possible to create a HTML doc from vars from a script, say the text returned of a display dialog, etc

what exactly did you have in mind?

hope this helps
-- An idea is salvation by imagination.
-- Frank Lloyd Wright
-- 30 --
     
tonymac
Dedicated MacNNer
Join Date: May 2000
Location: Chattanooga, TN
Status: Offline
Reply With Quote
Oct 10, 2000, 10:01 AM
 
I would recommend picking up a copy of the Visual Quickstart: AppleScript for the Internet. I found it to be a good primer for AppleScript, as well as showing internet applications, including writing CGI scripts in AppleScript.
     
Nebagakid  (op)
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status: Offline
Reply With Quote
Oct 14, 2000, 10:40 AM
 
I want to make this script that takes people's answer's to questions, turns them into characteristics of a doll, and then makes an html doc that shows various picutres of the doll.
     
Blobby
Guest
Status:
Reply With Quote
Oct 14, 2000, 07:20 PM
 
Do you mean something like allowing the user to put a lucky troll head on a barbie? The number of barbie variables alone would make this a very large and complex script.
     
Nebagakid  (op)
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status: Offline
Reply With Quote
Oct 14, 2000, 09:19 PM
 
I mean like there would be two choices for head color, and then it would be interpreted into an html doc so people could see how it looks.

------------------
CLOWNS!!!!!!!!!!!!!!!!!!!
     
l008com
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status: Offline
Reply With Quote
Oct 16, 2000, 05:10 PM
 
What you need is JavaScript, not AppleScript

------------------
I see dead people.
     
Nebagakid  (op)
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status: Offline
Reply With Quote
Oct 16, 2000, 10:53 PM
 
No No No! Applescript

------------------
CLOWNS!!!!!!!!!!!!!!!!!!!
     
MacCanada
Junior Member
Join Date: Oct 1999
Location: Edmonton, Alberta, Canada
Status: Offline
Reply With Quote
Oct 21, 2000, 10:49 AM
 
-- Here's An Example of What I believe to be
-- what you are looking for:


global theHTML, theTitle, htmlBC, htmlT, htmlL, htmlV, theBODY, theFileSpec

set theTitle to displayD("HTML <TITLE>:", "Your Title Here")
set htmlBC to displayD("1/5: HTML <BODY BGCOLOR>:", "BLACK")
set htmlT to displayD("2/5: HTML <BODY TEXT>:", "WHITE")
set htmlL to displayD("3/5: HTML <BODY LINK>", "WHITE")
set htmlA to displayD("4/5: HTML <BODY ALINK>:", "WHITE")
set htmlV to displayD("5/5: HTML <BODY VLINK>:", "WHITE")
set theBODY to displayD("HTML Content:", return & return & return & return & return & return & return & return & return & return & return & return & return & return)

set theHTML to "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">" & "<HTML>" & "<HEAD>" & "<TITLE>" & theTitle & "</TITLE>" & "</HEAD>" & "<BODY BGCOLOR=\"" & htmlBC & "\" TEXT=\"" & htmlT & "\" LINK=\"" & htmlL & "\" ALINK=\"" & htmlA & "\" VLINK=\"" & htmlV & "\">" & "<H2>" & theTitle & "</H2><BR>" & theBODY & "</BODY></HTML>"

try
try
set theFileSpec to (new file with prompt "Name The New HTML File" default name "interactive.html")
on error
return
end try
error "t"
--return theFileSpec
set x to (open for access theFileSpec with write permission) --theFileSpec)
write theHTML to x
close access x
on error err number num
close access x
display dialog "An Error Has Occured:" & return & return & err & tab & num & return & "Script Was Aborted." buttons "OK" default button 1 with icon 0
return err & tab & num
end try

on displayD(question, answer)
set theResult to text returned of (display dialog question default answer answer buttons {"Cancel", "OK"} default button 2)
return theResult as text
end displayD

-- In AppleScript a " is a Special character, for one to include
-- a " in a string in AppleScript one must first prefix the Quote (")
-- with a back slash like so:
-- \"

-- much as some words are reserved words to AppleScript
-- such is beep to utilize beep as a variable name
-- one must prefix & append a bar ( | ) to the reserved name like so:
-- |beep|
-- then the variable may be called as |beep|, this is useful
-- for some Scripters who would prefer to have clear verbose scripts.


-- hope this helps


------------------
-- An idea is salvation by imagination.
-- Frank Lloyd Wright
-- 30 --
-- An idea is salvation by imagination.
-- Frank Lloyd Wright
-- 30 --
     
   
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
Top
Privacy Policy
All times are GMT -4. The time now is 10:04 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,