Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
Not open for further replies.
I am new to Geektool and I cannot figure out how to get this script to work in the command part of the shell.

set info to ""
tell application "System Events"
set num to count (every process whose name is "iTunes")
end tell
if num > 0 then
tell application "iTunes"
if player state is playing then
set who to artist of current track
set what to name of current track
set onwhat to album of current track
set how to (time of current track)
set stars to (rating of current track) / 20 as integer
set info to (what & onwhat)
end if
end tell
end if
return info
end run

This works in applescript editor, but i cannont seem to get it to work in the command part of the shell in geektool. This will display iTunes song and album. What step and i missing?

In the shell command, you have to put the path of where that script is saved on your computer. For example, mine is saved as itunestitle in the folder of geektool under my username (rlpaolucci), so you would put this in the shell command:
osascript /User/USERNAME/FOLDER/itunestitle.scpt

...in other words, this is what MINE looks like...
osascript /User/rlpaolucci/geektool/itunestitle.scpt

it took forever for me to understand that...I hope I explained it okay for you.
 
How do I do that?

Geektool's in the Mac App Store! How's your geektool setup?
Yes, I know. Mine looks like the one in the example on the App Store - I really liked it.

Thanks for posting your setup. Would you mind providing a quick how-to on how we could replicate it? I'd really appreciate it. Thanks!
 
Hi guys have a small question, downloaded a calendar geeklet from the net but would like for the week to start with Monday instead of Sunday.

my code is

cal | sed -E '1,$'"s/ ($(date +%e))( |$)/ $(echo '\033[1;31m')\1$(echo '\033[0m')\2/"

thanks in advance
 
Last edited:
scutzi128,
Just saw your post today, sorry. Thanks for the compliment.

Without getting you completely frustrated with any directions I could possibly put together for the weather including the image, it may be easier for you to watch the following Youtube video. She also has the links to download the scripts under the video controls, it'll include directions for the weather. http://www.youtube.com/watch?v=uNFkW1lLxtU

As far as the Time, Month, Date, and AM/PM separately use the following in the Geektool Shell Command field. Remember to set your refresh times appropriately.

Time:
date '+%I:%M'

Month
date +%B

Date
date +%d

AM/PM
date +"%p"

For fonts I just used Helvetica Neue Light, Medium or Regular.

"The launchers" are Dragthing menus. I've tried others, but I like the customizing features the best. It's really easy to use and they have great support. Since my last posting I put my drives in a drop-down also to clean up my desktop even more. I called the tab "Drives" in the upper right corner, but you can name them anything. The left menu that you see open (for the screenshot only) are the currently open apps "Processes". You can make a menu for just about anything. They may have a demo for you to use, but I can't recall. http://www.dragthing.com/index.html

The "widget" for iTunes is simply a Bowtie skin. Quick and easy. http://bowtieapp.com/

Any other Q's please feel free.


Hello Psimonium

I'm french and i love your wallpaper...

Could you give me a link where I can download it?

Thanks for your help !

Regards
 
In the shell command, you have to put the path of where that script is saved on your computer. For example, mine is saved as itunestitle in the folder of geektool under my username (rlpaolucci), so you would put this in the shell command:
osascript /User/USERNAME/FOLDER/itunestitle.scpt

...in other words, this is what MINE looks like...
osascript /User/rlpaolucci/geektool/itunestitle.scpt

it took forever for me to understand that...I hope I explained it okay for you.

Maybe i am missing something here this seems rather simple the way you explained it. Here is what i did, maybe you can tell me where i went wrong..

I save all of that script in textedit and saved it under my username and in my geektool folder. When i went to put, osascript /User/rlpaolucci/geektool/itunestitle.scpt, into the shell command box it did not work. Do i have to have the .scpt at the end. because i had .rtf
 
Maybe i am missing something here this seems rather simple the way you explained it. Here is what i did, maybe you can tell me where i went wrong..

I save all of that script in textedit and saved it under my username and in my geektool folder. When i went to put, osascript /User/rlpaolucci/geektool/itunestitle.scpt, into the shell command box it did not work. Do i have to have the .scpt at the end. because i had .rtf

Instead of using textedit, use AppleScript Editor, and you'll then get .scpt
and remember, use YOUR username, not mine.
Also, is your geektool under another folder (ex-documents?)... because when it's under my username, the folder geektool isn't under any other folder (look at picture below--rlpaolucci is highlighted and you'll see my geektool folder).


osascript /User/YOURUSERNAMEHERE/GEEKTOOLFOLDER/SCRIPTNAMEHERE.scpt
 

Attachments

  • Screen shot 2011-08-31 at 5.42.55 PM.png
    Screen shot 2011-08-31 at 5.42.55 PM.png
    92.1 KB · Views: 119
Last edited:
Hi,

Does anyone have solid weather and weather image scripts that do no require any other downloads or programs? Just simple scripts that I can enter into a shell or image selection?

How about any good processes scripts?

I am new to GeekTool and I have searched the thread but a lot of these scripts show up blank for me.

Thank you.

Try this website. No downloads needed.
http://gtwthr.com/

----------



I got most of my scripts from here: http://www.macosxtips.co.uk/geeklets/

If anyone wants the background images just respond with your email address and I'll send 'em your way.
 
Geektool's in the Mac App Store! How's your geektool setup?
Yes, I know. Mine looks like the one in the example on the App Store - I really liked it.

Hey I'm new to geek tool and i really like this setup. how did you do it / whats the script for it?

Thanks.
 
Thanks

Instead of using textedit, use AppleScript Editor, and you'll then get .scpt
and remember, use YOUR username, not mine.
Also, is your geektool under another folder (ex-documents?)... because when it's under my username, the folder geektool isn't under any other folder (look at picture below--rlpaolucci is highlighted and you'll see my geektool folder).


osascript /User/YOURUSERNAMEHERE/GEEKTOOLFOLDER/SCRIPTNAMEHERE.scpt

Thanks. I had the /User/ part wrong. Mine is under Users. haha one little letter and the whole thing doesnt work. Now i have another question for you since i see you have it working correctly.

How do you get weather images and the current temperature to work? Or the flip clock that you have. I have been trying to figure the weather out for a day and cant get it to work. I've looked up tips and still cant figure it out. I havent even tried on the flip clock. I dont even know where to begin for that.

If you could help i would be greatly appreciative.
 
Thanks. I had the /User/ part wrong. Mine is under Users. haha one little letter and the whole thing doesnt work. Now i have another question for you since i see you have it working correctly.

How do you get weather images and the current temperature to work? Or the flip clock that you have. I have been trying to figure the weather out for a day and cant get it to work. I've looked up tips and still cant figure it out. I havent even tried on the flip clock. I dont even know where to begin for that.

If you could help i would be greatly appreciative.

Yes, one little letter will mess it all up hah :)
For the weather & flipclock, go to pg 115, post number 2875. For the clock, for the refresh time, I had to put 3660seconds for the hour & 1second for the minute.
Until I found that post, the weather was the absolute, most difficult script I've dealt with (I'm pretty sure that goes for everyone else as well). I haven't gotten the weather image to work yet. I'm still messing with it. There's actually a youtube video where a girl shows how to put the weather image on there. I'm going to watch it tonight, since I plan on changing my desktop again.
Don't forget, when you do the weather scripts, make sure you put a refresh time.
Here's the video: http://www.youtube.com/user/CoolEnufForaMac#p/u/12/uNFkW1lLxtU
Goodluck! I'd like to see your desktop when you're done :)
 
This is how my desktop looks now. Any ideas on how to make it better? I find it nice but a little boring now...
 

Attachments

  • Screen Shot 2011-08-31 at 9.59.00 PM.png
    Screen Shot 2011-08-31 at 9.59.00 PM.png
    1 MB · Views: 150
So Far

Yes, one little letter will mess it all up hah :)
For the weather & flipclock, go to pg 115, post number 2875. For the clock, for the refresh time, I had to put 3660seconds for the hour & 1second for the minute.
Until I found that post, the weather was the absolute, most difficult script I've dealt with (I'm pretty sure that goes for everyone else as well). I haven't gotten the weather image to work yet. I'm still messing with it. There's actually a youtube video where a girl shows how to put the weather image on there. I'm going to watch it tonight, since I plan on changing my desktop again.
Don't forget, when you do the weather scripts, make sure you put a refresh time.
Here's the video: http://www.youtube.com/user/CoolEnufForaMac#p/u/12/uNFkW1lLxtU
Goodluck! I'd like to see your desktop when you're done :)

This is what i have so far.. I can't figure out the weather. When i put the script into applescript editor the word "curl" does not work. I dont know what to use instead of that. Do i even need to use applescript editor?
 

Attachments

  • Geektool  copy.jpg
    Geektool copy.jpg
    195.7 KB · Views: 152
This is what i have so far.. I can't figure out the weather. When i put the script into applescript editor the word "curl" does not work. I dont know what to use instead of that. Do i even need to use applescript editor?

Very nice!
Don't put any of the weather scripts into Applescript Editor, just put all of them straight into the shell command itself.
Also, for the two day weather conditions and F degrees, click RSS box in your link bar to get your link.
At first it comes out to C degrees...I'm assuming you don't want that, so use these two scripts for F degrees (took me forever to turn into F degrees)

curl --silent "YOURRSSLINKHERE=F" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1

curl "YOURRSSLINKHERE=f" | grep -e "Forecast:" -A 2 | tail -n 2 | sed -e 's/<br \/>//' -e 's/<BR \/>//' | sed "s/\(.*\)\.\ \(.*\)/\1\?\2/" | tr "?" "\n" | sed "s/Hi\:\ \(.*\)\ Lo\:\ \(.*\)/\?Hi\: \1\ Lo\:\ \2/" | sed "s/\?\(.*\)/\\1/"
 
Very nice!
Don't put any of the weather scripts into Applescript Editor, just put all of them straight into the shell command itself.
Also, for the two day weather conditions and F degrees, click RSS box in your link bar to get your link.
At first it comes out to C degrees...I'm assuming you don't want that, so use these two scripts for F degrees (took me forever to turn into F degrees)

curl --silent "YOURRSSLINKHERE=F" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1

curl "YOURRSSLINKHERE=f" | grep -e "Forecast:" -A 2 | tail -n 2 | sed -e 's/<br \/>//' -e 's/<BR \/>//' | sed "s/\(.*\)\.\ \(.*\)/\1\?\2/" | tr "?" "\n" | sed "s/Hi\:\ \(.*\)\ Lo\:\ \(.*\)/\?Hi\: \1\ Lo\:\ \2/" | sed "s/\?\(.*\)/\\1/"


Well I have got the weather image to work great. I dont think i was saving it the correct way. But, i have used the script that you provided that would produce the Current Temp in F degrees. I used the RSS link so again.. i am doing something wrong.
 
Very nice!
Don't put any of the weather scripts into Applescript Editor, just put all of them straight into the shell command itself.
Also, for the two day weather conditions and F degrees, click RSS box in your link bar to get your link.
At first it comes out to C degrees...I'm assuming you don't want that, so use these two scripts for F degrees (took me forever to turn into F degrees)

curl --silent "YOURRSSLINKHERE=F" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1

curl "YOURRSSLINKHERE=f" | grep -e "Forecast:" -A 2 | tail -n 2 | sed -e 's/<br \/>//' -e 's/<BR \/>//' | sed "s/\(.*\)\.\ \(.*\)/\1\?\2/" | tr "?" "\n" | sed "s/Hi\:\ \(.*\)\ Lo\:\ \(.*\)/\?Hi\: \1\ Lo\:\ \2/" | sed "s/\?\(.*\)/\\1/"


Never mind got it working :). Now, I have only seen people use yahoo as the weather service. Is it possible to use weather.com to get the weather? Weather.com is incredibly more accurate that yahoo.
 
It's a start!

This is on my 20" Cinema Display, secondary. Just downloaded Geektool like 30 minutes ago...
28i1fyu.png
 
Last edited by a moderator:
Never mind got it working :). Now, I have only seen people use yahoo as the weather service. Is it possible to use weather.com to get the weather? Weather.com is incredibly more accurate that yahoo.

I'm not sure if it's possible. I know weather.com doesn't have an RSS link. You can always try it. I'll also try it later tonight.

I made a new one, but for some reason it's not letting me upload. "/
EDIT: it finally let me upload my background...what's not showing is iTunes Now Playing/Paused & Artist/Track
 

Attachments

  • Screen shot 2011-09-02 at 10.00.32 PM.jpg
    Screen shot 2011-09-02 at 10.00.32 PM.jpg
    338.9 KB · Views: 179
Last edited:
Is osascript broken in 10.7(.1)? Any applescripts i've been trying to run via geektool seemingly run however they never provide any output but instead remain empty within geeklet. For example I have the following code:

Code:
echo 'Skype:'; osascript ~/Documents/Scripts/SkypeOnlineUsers.scpt | tr , "\n" | iconv -f UTF-8 -t L1

Coupled to the following applescript:

Code:
(* This script displays returns all of your Skype contacts who are online, displays their moodtext (if they have one) and drops the echo123 test contact from the list.
(C) Hannes Bretschneider *)


on remvix(ix, ls)
	if ls is {} then
		return {}
	else if ix is 1 then
		return rest of ls
	else
		return {item 1 of ls} & remvix(ix - 1, rest of ls)
	end if
end remvix

on tail(astring, k)
	return do shell script "echo '" & astring & "' | awk '{{i = " & k & "; while ( i <= NF-1 ) {printf $i \" \"; i++}; printf $i}}'"
end tail

property onlinegroup : 0

on getgroup()
	tell application "Skype"
		if my checkgroup(onlinegroup) is true then
			return onlinegroup
		else
			set hardwired to send command "search groups hardwired" script name "online users"
			set hardwired to my tail(hardwired, 2)
			set hardwired to text items of hardwired
			repeat with i in hardwired
				if my checkgroup(i) is true then
					return i
				end if
			end repeat
		end if
	end tell
end getgroup

on checkgroup(group_id)
	tell application "Skype"
		set grouptype to send command "get group " & group_id & " type" script name "online users"
		set grouptype to my tail(grouptype, 4)
		if grouptype is "ONLINE_FRIENDS" then
			return true
		else
			return false
		end if
	end tell
end checkgroup

property dropped : 0
set text item delimiters to ", "
set onlineusers to {}
tell application "System Events"
	set powerCheck to ((application processes whose (name is equal to "Skype")) count)
	
	if powerCheck = 0 then
		set end of onlineusers to " Skype not running"
	else
		tell application "Skype"
			set onlinegroup to my getgroup()
			set skype_id to send command "get group " & onlinegroup & " users" script name "online users"
			set skype_id to my tail(skype_id, 4)
			set skype_id to text items of skype_id
			repeat with j from 1 to count skype_id
				if item j of skype_id is "echo123" then
					set skype_id_new to my remvix(j, skype_id)
					set dropped to 1
				end if
			end repeat
			if dropped is 1 then
				set skype_id to skype_id_new
			end if
			repeat with i in skype_id
				set aUser to send command "get user " & i & " fullname" script name "online users"
				set aUser to my tail(aUser, 4)
				if aUser is "" then set aUser to i
				set amoodtext to send command "get user " & i & " mood_text" script name "online users"
				set amoodtext to my tail(amoodtext, 4)
				if amoodtext is "" then
					set end of onlineusers to aUser
				else
					set end of onlineusers to aUser
				end if
			end repeat
			
			if (count skype_id) > 0 then
				set item 1 of onlineusers to " " & item 1 of onlineusers
			else
				set beginning of onlineusers to " No Contacts Online"
			end if
			return onlineusers
		end tell
	end if
end tell

However it does not seem work correctly, neither do any of my other osascript commands for weather etc. The above script simply says 'Skype:' from it's echo command but does not display any info. Any help would be appreciated. Thanks!
 
My take on the Geektools desktop from the appstore screenshot.
 

Attachments

  • Screen Shot 2011-09-03 at 12.46.13 AM.jpg
    Screen Shot 2011-09-03 at 12.46.13 AM.jpg
    112.2 KB · Views: 520
Last edited:
Hey guys, anyone familiar with boxoh.com? Its a package tracker. Put in a tracking number, it charts it on google maps and gives you an RSS feed of the package's progress.

Could someone code up a simple script that grabs the RSS data from boxoh? Ideally it would be 1 script, with one variable that you'd need to replace (the tracking number).

The site is relatively simple. A direct link to the rss feed of any package tracked is simply:
http://boxoh.com/?rss=1&t="Tracking#".


Related to this, does anyone have any good resources for Python and how to scrape data from things like RSS feeds, removing the html formatting? I want to figure out how that all works. Thanks!
 
Last edited:
Hey all,

New to GeekTool, and while I have only used some simple date/itunes/spotify stuff so far, I was more interested in what I could pull off with images.

Would it be possible to make image conditions based on the time range? I know that the weather scripts can pull certain images based on the weather report, so could I have it pull up a different background image for different points of the day (sunrise, morning, afternoon, sunset, night, etc)?

My idea is to photograph the same location at the various points of the day so it would kind of blend together.

I'm not really too familiar with the coding, but my basic concept would be some like "If the time is within the range of 6:00am to 8:00am, it would load the sunrise image". The different ranges would yield different images and so forth.

Is this possible? :)
 
I'm not sure if it's possible. I know weather.com doesn't have an RSS link. You can always try it. I'll also try it later tonight.

I made a new one, but for some reason it's not letting me upload. "/
EDIT: it finally let me upload my background...what's not showing is iTunes Now Playing/Paused & Artist/Track

Here is what mine looks like now that i have the weather stuff working. I have to figure out how to get the itunes to show paused and album artwork. The little black words are track title and artist. I cannot figure out how to but a space between the title and the artist.

I did have my flip clock working, but all of the sudden it wont let me put the time and date over the picture. o well..something to work on.
 

Attachments

  • desktop 1 copy.jpg
    desktop 1 copy.jpg
    204.5 KB · Views: 172
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.