Fwd: Unexpected Argument problem
Fwd: Unexpected Argument problem
- Subject: Fwd: Unexpected Argument problem
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 3 Jan 2008 16:45:59 -0500
---------- Forwarded message ----------
From: "Mark J. Reed" <email@hidden>
Date: Thu, 3 Jan 2008 16:45:14 -0500
Subject: Re: Unexpected Argument problem
To: Dale Parrott <email@hidden>
You're right about the spaces. Always use "quoted form of posix
path", not just "posix path", when constructing command strings for
"do shell script".
On 1/3/08, Dale Parrott <email@hidden> wrote:
> I am attempting to write the following script to automate changing the
> login screen desktop picture.
> I'm missing something and could use some help.
> Here is the script:
> _________________________________
> display dialog "This program will change your login screen background
> to a picture that you select. Do you wish to continue?"
> tell application "Finder"
> set image_path to choose file with prompt "Choose an image that you
> want to set for the background"
> end tell
> set my_image to POSIX path of image_path as string
> do shell script "defaults write /Library/Preferences/
> com.apple.loginwindow DesktopPicture " & my_image with administrator
> privileges
> ________________________________
>
> Here is the error I get:
>
> "defaults[980:923] Unexpected argument Pictures/Jaguar; leaving
> defaults unchanged"
>
> Here is the path to the file I choose: "/Library/Desktop Pictures/
> Jaguar Aqua Blue.jpg"
>
> I'm thinking it has something to do with the spaces, but I'm unsure as
> how to fix this.
> Any ideas?
>
> thanks
> dale
--
Mark J. Reed <email@hidden>
--
Mark J. Reed <email@hidden>
_______________________________________________
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