Re: Changing Safari's Homepage with a little intellegence
Re: Changing Safari's Homepage with a little intellegence
- Subject: Re: Changing Safari's Homepage with a little intellegence
- From: Stan Cleveland <email@hidden>
- Date: Thu, 22 Sep 2016 12:34:06 -0700
On Sep 22, 2016, at 12:17 PM, Jeffrey Madson <email@hidden> wrote:
Thanks for taking a peek at this. I'm trying to write a script that will change the current users Safari Home Page. I can do this using a terminal command in Applescript: do shell script "defaults write /Users/"current user"/Library/Preferences/com.apple.Safari HomePage http://www.apple.com but I have two problems. 1) I can only get this to work if I know who the "current user" is and I will never know so I need something that will change whoever is currently logged in. 2) I need to build in a little intellegence because I only want the address changed to http://www.apple.com if it's pointing at http://www.google.com (these are only examples). If it's pointing at anything besideshttp://www.google.com I don't want to change it. Can this be done in AppleScript and is there a better way then inserting the shell script?
Hi Jeffrey,
In any unix, the current user's home folder is represented by a tilde. Thus, this works: "~/Library/Preferences/com.apple.Safari"
Stan C.
|
_______________________________________________
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