Posted on Mon - November 28, 2005 NeoWayland dot NetI use NeoWayland dot Net as sort of a central
directory. I use a redirect service to direct people to the actual page which
lives on my iDisk.
This script puts an updated page in the right place on my iDisk. It's nothing spectacular, but it does illustrate a couple of things that I think are important. First I like my scripts to be editable so I can change them and tweak them as I like. And that raises the second issue, how do you get around embedding your username and password in an open script? The solution is actually pretty simple, have
the script call an alias instead of the actual iDisk. That way it hands off the
security to the OS. The first time the alias is used, your Keychain opens and
it will want the username and password. After that it is
simple.
Let's go through this step by step. First see if the iDisk is mounted. If not, the computer mounts it. The delay is necessary even on a fast connection. It might need to be increased for dialup. tell
application
"Finder"
set
iDisk
to
0
if
disk
"neowayland"
exists
then
set
iDisk
to
1
else
open
file
"Users:neo:Sites:neowaylanddotnet:disk of i"
delay
if
disk
"neowayland"
exists
then
set
iDisk
to
1
else
say
"i disk not available"
end
if
end
if
Next, if the iDisk is mounted, it deletes the existing web page file. This is actually the fastest way I have found to delete files on your iDisk. if
iDisk >
0 then
if
file
"index.html"
of
folder
"Sites"
of
disk
"neowayland"
exists
then
delete
file
"index.html"
of
folder
"Sites"
of
disk
"neowayland"
else
say
"website is missing"
end
if
Then it is a simple copy. The funky URL is one of the internals from the page itself. In this case it brings up the NeoWayland NetWork part of the link directory. duplicate
file
"Users:neo:Sites:neowaylanddotnet:index.html"
to
folder
"Sites"
of
disk
"neowayland"
say
"nee owayland dot net is ready"
if
process
"Safari"
exists
then
tell
application
"Safari"
open
location
"http://homepage.mac.com/neowayland/#NWNW"
end
tell
end
if
else
say
"not even. You aren't networked"
end
if
end
tell
And here is the whole script in one block. tell
application
"Finder"
set
iDisk
to
0
if
disk
"neowayland"
exists
then
set
iDisk
to
1
else
open
file
"Users:neo:Sites:neowaylanddotnet:disk of i"
delay
if
disk
"neowayland"
exists
then
set
iDisk
to
1
else
say
"i disk not available"
end
if
end
if
if
iDisk >
0 then
if
file
"index.html"
of
folder
"Sites"
of
disk
"neowayland"
exists
then
delete
file
"index.html"
of
folder
"Sites"
of
disk
"neowayland"
else
say
"website is missing"
end
if
duplicate
file
"Users:neo:Sites:neowaylanddotnet:index.html"
to
folder
"Sites"
of
disk
"neowayland"
say
"nee owayland dot net is ready"
if
process
"Safari"
exists
then
tell
application
"Safari"
open
location
"http://homepage.mac.com/neowayland/#NWNW"
end
tell
end
if
else
say
"not even. You aren't networked"
end
if
end
tell
|
Hello There
This is my no frills blog to cover all the gadgets and gizmos and technology that makes 21st Century life so exciting. Think of it as a messy set of notes that I keep for myself on all sorts of topics. It's really intended for my personal use, but I will explain sometimes as I go along.
My passion is for Macintosh and other Apple products, but I will use others as needed. If my notes and experiences can help or amuse you, so much the better. Categories
Calendar
Archives
XML/RSS Feed
Neolinks
Homepage AOL Homepage Geocities Homepage Dot Mac Homepage PaganVigil AOL Pagan Vigil Geocities Pagan Vigil Dot Mac Pagan Vigil Technopagan Yearnings AOL Technopagan Yearnings Geocities Technopagan Yearnings Dot Mac Technopagan Yearnings Webmaster NetworkSolutions Dot Mac dotmac.info WhatTheFont MacHighway America Online Yahoo! Geocites ZoneEdit iBlog HaloScan StatCounter Feed to JavaScript Performancing Design Re-Imagineering Steampunk Workshop Design Observer Subtraction Paleo-Future Hardware Apple CDW Cyberguys PCMall X-Treme Geek Software TypeStyler Graphic Converter Palm News & Info Palm Infocenter Brighthand Forums - Palm mytreo.net Making Music Apple - iLife - GarageBand iCompositions Royalty Free Music, Free Sound Effects, Royalty-free Sounds Tune Up Loops Twin Cities MIDI Home Page Andy's OSX Music Page Apple Logic Pro - AUDIO Hints & Tips Library of scanned player piano music rolls Garritan Orchestral Libraries Drums on Demand Bandmateloops Coolness Gizmodo Engadget Daring Fireball RoughlyDrafted Magazine Applefritter iGeek MaKiDo Mac vs. PC Info Why I Hate Microsoft World of Ends Tracking What Is My IP Address? IP Address Trace Geektools WHOIS ARIN WHOIS Database Search Zabra People Search NeoBlogs
Statistics
Total entries in this blog:
Total entries in this category: Published On: Dec 07, 2008 01:28 PM |