RE: AppleScript In Web Publishing...
RE: AppleScript In Web Publishing...
- Subject: RE: AppleScript In Web Publishing...
- From: "Stockly, Ed" <email@hidden>
- Date: Mon, 5 Mar 2007 13:35:00 -0800
Peter,
It sounds like you want to use AppleScript to create a fairly simple, straight-forward page of links to specific files using AppleScript.
Here's how I would tackle a project like this:
Create a template page (Using BB Edit, or whatever HTML editing software you prefer.)
Divide the page into sections:
Header: which comes before links
Link prefix: which comes before each link
Link suffix: which follows each link
Footer: which follows last link
In the HTML template, use unique comments to keep these parts separate.
save your template where your appleScript knows where it is.
To start with I would "hard wire" the path into the script:
set myTemplate to "drive:file" as alias
Then, use something like this:
set dirWithFilesToLinkTo to choose folder with prompt "Navigate to folder with files you want to include in the HTML"
Use the finder to get a list of files, and use appleScript to message the file paths to valid links.
Next read your template document and use text item delimiters to break it into its segments, then reassemble your document, adding the links to the files in a repeat loop
something like this:
set htmlDoc to {htmlHeader}
repeat with thisURL in listOfURLs
set the end of htmlDoc to linkPrefix
set the end of htmlDoc to thisURL as string
set the end of htmlDoc to linkSuffix
end repeat
set the end of htmlDoc to htmlFooter
set htmlDoc to htmlDoc as string
Write the document to a new file.
HTH,
ES
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden