02-10-2009, 09:46 AM #1
silly question from a newbie (AppleScript)
- Member Since
- Feb 10, 2009
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.."
get document 1
save document 1 in "directory/name.html"
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.
02-12-2009, 03:14 AM #2
- Member Since
- Jun 25, 2005
- On the road
- 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
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.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By panchoskywalker in forum Music, Audio, and PodcastingReplies: 7Last Post: 01-20-2014, 12:46 PM
By Splint in forum OS X - Operating SystemReplies: 4Last Post: 06-23-2010, 11:08 PM
By nickharambee in forum OS X - Operating SystemReplies: 0Last Post: 10-21-2009, 07:10 AM
By revilo in forum OS X - Operating SystemReplies: 3Last Post: 09-09-2009, 04:22 AM
By ourhero in forum Apple DesktopsReplies: 4Last Post: 11-30-2006, 06:17 PM