Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Toggle Screensaver - OP Feedback & POSIX file issues



This works for me:
set pf to ("/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup") as Unicode text

On 2/20/06, Mr Tea <email@hidden> wrote:
Thanks again to John C Welch for the info about the systemsetup file buried
inside the 'ARDAgent' application, even though it wasn't what I was looking
for initially.

Using the script worked up by Kai and the options presented by John's tip, I
can now turn off screensaver activation and turn on display sleep in one
fell swoop, and the same in reverse. Marvellous, and for my purposes, even
better than what I originally set out to achieve.

I have some further questions about that 'systemsetup' file, though...

I'm not terribly au fait with shell scripting, so it took a bit of digging
around to figure out how to act on the info provided by Mr Welch. Seems that
I need to get a posix path to the file, append the relevant command, and run
it as a shell script. Simple really.

So, is 'systemsetup' a Unix executable file? (I've long been aware of the
existence of these fabled entities, but never quite understood what they
were about.)

Also, when I saw that systemsetup was actually an alias file, I looked for
the original, and found that it pointed to a file called
'systemsetup-panther' in the same directory (there was also one called
'systemsetup-jaguar'). Is this as it should be?

Finally, I encountered some strange issues with the posix file thing. Take
this single line script:

-->>>>>
set pf to POSIX file
"/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support
/systemsetup"
--<<<<<

If I type or paste the above into a script editor, then compile or run it,
the word 'POSIX' vanishes from the line and the slash-delimited path changes
into a colon delimited path. Why?

Worse than this, if I compile the script, then try to run it, I get an error
message: 'Can't make file "blah:blah" into type reference', and the text of
the path changes from Unicode to a crummy old string. BUT, if I run the same
script WITHOUT compiling it first, it runs just fine, time after time.
Surely this is a bug?

NB ­ I found that the compile/run problem could be avoided by putting the
posix-style path in a variable, thusly:

-->>>>>
set pp to
"/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support
/systemsetup"

set pf to POSIX file pp
--<<<<<

... but surely this extra step should not be necessary.



Nick
pp Mr Tea
--

Brew of the day: PG Tips

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden



--
Some minds remain open long enough for a truth to both enter and leave without processing.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden

References: 
 >Re: Toggle Screensaver (From: "John C. Welch" <email@hidden>)
 >Re: Toggle Screensaver - OP Feedback & POSIX file issues (From: Mr Tea <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.