Hello
Making a bit of cleaning in my archives I retrieved a short script :
on desktop_size() return {word -1 of (do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -w Width") as integer, word -1 of (do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -w Height") as integer} end desktop_size
my desktop_size()
As I am curious I decided to try to rewrite it so that it read only once the preferences file. If i understand well, the first part of the instruction : defaults read /Library/Preferences/com.apple.windowserver
reads the preferences file then the grabbed text is passed to grep.
So I wrote : set rawText to (do shell script "defaults read /Library/Preferences/com.apple.windowserver") do shell script "echo " & rawText & " | grep -w Width"
It failed.
I tried also a syntax which I saw in sed instructions :
set rawText to (do shell script "defaults read /Library/Preferences/com.apple.windowserver") do shell script "grep -w Width <<< " & rawText
it failed too.
Am I Am I trying to do an impossible task ? If it's If it's possible, what is the correct syntax ?
Yvan KOENIG (VALLAURIS, France) lundi 30 décembre 2013 12:00:39
|