New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

silly question from a newbie (AppleScript)

Post Reply New Thread Subscribe

Thread Tools

Member Since: Feb 10, 2009
Posts: 1
quariguasi is on a distinguished road

quariguasi is offline
I am doing a silly applications in AppleScript that opens and saves the content of a web page:

tell application "Safari"
make new document at end of documents
set URL of document 1 to "www.url.."
delay 2
get document 1
delay 10
save document 1 in "directory/name.html"
end tell
delay 10

Here comes the catch: Instead of saving name.html, it saves "directory/name.html" as a file in the root directory.

Can someone help me? I could not find the problem.

QUOTE Thanks

xstep's Avatar
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
A quick test showed that Applescript is set to the root ('/') directory. Well, at least when I post a 'do shell script ' command.

You either will have to use a full path, or set the path relative to something like your home directory. If relative to your home directory, then try placing '~/' before the directory like this;
save document 1 in "~/directory/name.html"

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks

Post Reply New Thread Subscribe

« Open GL ES | Help with PackageMaker needed »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting 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 Off
Forum Jump

Similar Threads
Thread Starter
Last Post
Silly question: how to burn a CD 754T Switcher Hangout 7 05-01-2008 05:15 PM
newbie question about programming languages MacGal OS X - Development and Darwin 10 03-28-2008 08:52 PM
help - newbie question re iMac and Apple TV.... thanks kpertsch Other Hardware and Peripherals 1 03-05-2008 12:31 AM
Silly Light Question verdejt Apple Desktops 5 02-11-2008 07:11 PM
mac newbie question (iWeb) Emuleem22 Switcher Hangout 4 03-02-2006 10:03 PM

All times are GMT -4. The time now is 02:02 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?