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.
That's pretty awesome... But is there a way to show up the previous, but more importantly, the next song to actually play? I've looked on the dictionary, and I couldnt find anything... By the way, thanks a lot for the answers shomann... trust me you help me a lot! Like for the playlist: it worked perfectly!!! Do you know a website that explains Applescript? Id like to learn on my own without asking questions every 2 seconds! ;)

And for your multiple weather script... Wouldnt this use a lot more CPU than just one script?

Well, thanks for the thanks :)

I am not quite sure what you are asking. This script does give you the previous and the next track from whatever the current playlist is.

The weather script is about making something universal that is easy for everyone to use. I am not sure if it will truly be more CPU heavy or not until I get it done. However, I have to believe that if I am downloading the file/info once, parsing it once, and spreading the access across several files that it won't be too bad. It won't be the type of script you refresh every 1 sec anyway ;) I know the concept is sound as I am about 1/3 of the way through the coding/testing right now.

To share a secret, I actually bought the book Applescript for Dummies way back when all Macs were beige, and our operating system was still in the single digits. ;) That said, I think Macscripter is an Applescript oriented site. My method is doing a Google search for the topic I need and seeing what info is out there.
 
Easy Peasy

haha, oh dear. i was being a complete muppet. i was pasting in the "Date: code" bit as well, i didnt realise they were just there for reference purposes. Thank you for your help! Is much appreciated!
One other quick think while im here.. how would i get it to say "Time:" before the time? because at the moment it just says 22:59. Thanks!

I have an answer for you

just type Echo "INSERT TEXT HERE" and it will display any text on your desktop, just replace the INSERT TEXT HERE with whatever you want.

:)
 
Well, thanks for the thanks :)

I am not quite sure what you are asking. This script does give you the previous and the next track from whatever the current playlist is.

The weather script is about making something universal that is easy for everyone to use. I am not sure if it will truly be more CPU heavy or not until I get it done. However, I have to believe that if I am downloading the file/info once, parsing it once, and spreading the access across several files that it won't be too bad. It won't be the type of script you refresh every 1 sec anyway ;) I know the concept is sound as I am about 1/3 of the way through the coding/testing right now.

To share a secret, I actually bought the book Applescript for Dummies way back when all Macs were beige, and our operating system was still in the single digits. ;) That said, I think Macscripter is an Applescript oriented site. My method is doing a Google search for the topic I need and seeing what info is out there.

For the iTunes script, i mean when youre on shuffle, your script shows the next and previous track on the playlist, but not the track that is next to play and the one that just played.
And thanks, again, (!) for the website! Ill go check when I have more time! :D
 
For the iTunes script, i mean when youre on shuffle, your script shows the next and previous track on the playlist, but not the track that is next to play and the one that just played.
And thanks, again, (!) for the website! Ill go check when I have more time! :D

I see what you are getting at. You are accessing your main Music library and just shuffling that content. I rarely play music that way, so I didn't see the issue.

I don't want to say it's impossible...but... I don't know how to ask iTunes to grab those internal values. I do have a suggestion though. Use the iTunes DJ and just set it to your main Music library when you play back. The script then works as it should.
 
I see what you are getting at. You are accessing your main Music library and just shuffling that content. I rarely play music that way, so I didn't see the issue.

I don't want to say it's impossible...but... I don't know how to ask iTunes to grab those internal values. I do have a suggestion though. Use the iTunes DJ and just set it to your main Music library when you play back. The script then works as it should.
Ok, well thanks anyway! :)
 
Ive always thought we werent able to change the color of a certain part of a script when using geektool. But i just found something interesting:
Code:
#!/usr/bin/env ruby
#
# Author: Robert Jorgenson
# Author email: rjorgenson@gmail.com
require 'Date'
ABBR_DAYNAMES = {0, 'Su', 1, 'Mo', 2, 'Tu', 3, 'We', 4, 'Th', 5, 'Fr', 6, 'Sa'}

def days_in_month(year, month)
  return (Date.new(year, 12, 31) << (12 - month)).day
end

def day_in_month(year, month, day)
  return Date.new(year, month, day).wday
end

def build_day_array(year, month)
  day_array = Array.new
  for d in (1..days_in_month(year, month))
    day_array[d] = ABBR_DAYNAMES[day_in_month(year, month, d)]
  end
  day_array.shift
  return day_array * "   "
end

def build_separator(year, month)
  #color = "\e[32m" #green
  color = "\e[31m" #uncomment for red
  separator_string = "==" # change this to change separator, best if 2 characters wide
  close = "\e[0m" # don't change this
  separator = Array.new
  for d in (1..days_in_month(year, month))
    if year == Time.now.year && month == Time.now.month && d == Time.now.day then
      separator[d] = "#{color}#{separator_string}#{close}"
    else
      separator[d] = "#{separator_string}"
    end
  end
  separator.shift
  return separator * "   "
end

def build_date_array(year, month)
  date_array = Array.new
  for d in (1..days_in_month(year, month))
    date_array[d] = d
  end
  date_array.shift
  date_array.each do |d|
    if d < 10 then
      date_array[(d-1)] = "0#{d}"
    end
  end
  return date_array * "   "
end

year = Time.now.year
month = Time.now.month

puts build_day_array(year, month)
puts build_separator(year, month)
puts build_date_array(year, month)
I found it here :
HTML:
http://www.macosxtips.co.uk/geeklets/system/dateline-style-calendar-1/
This guy did it! The calendar is the color that you want, but he can put the date in red (or green)! Is it because he uses ruby?
 
It's Geektool 3 that allows color in escape sequences...

Ive always thought we werent able to change the color of a certain part of a script when using geektool. But i just found something interesting:

(...)
This guy did it! The calendar is the color that you want, but he can put the date in red (or green)! Is it because he uses ruby?

Geektool 3 and some other variants now have the ability to display ANSI color codes directly in shell scripts. Used to be, I had to make two separate Geektool items, one for each color, but the color codes (like "\e[32m" in the script) are the 'escape sequences' that adds the color, not the use of the Ruby language.

FYI, ANSI color codes have been used in Unix shell scripts since the dawn of time, but now they can be displayed directly in Geektool, which is the innovation.
 
Geektool 3 and some other variants now have the ability to display ANSI color codes directly in shell scripts. Used to be, I had to make two separate Geektool items, one for each color, but the color codes (like "\e[32m" in the script) are the 'escape sequences' that adds the color, not the use of the Ruby language.

FYI, ANSI color codes have been used in Unix shell scripts since the dawn of time, but now they can be displayed directly in Geektool, which is the innovation.
ok, thanks!
but now, to make things more interesting, how can I use the ANSI color codes on applescript? I tried to search for info on google, but didn't find anything...
 
.txt in Geektool

Hi,

I wanted to display a .txt file on my desktop using geektool but I'm experiencing some problems.

First of all I doesn't update when I change the .txt file, I have to log out and back in again to get an update.

Also when I change something in geektool the text from the file is displayed over and over and over again in the entire geektool window.

Does anybody know how to fix this?

Also I wan't my weekly training plan to be displayed and updated as I get the workouts done. Is there a smart way to do this?

Lonnie
 
Screenshot2010-04-17at105635AM.png


I'm sure this is simple I'm just a bit of a geektool noob. How do I the grey overlay like in this picture?
 
Hi,
First of all I doesn't update when I change the .txt file, I have to log out and back in again to get an update.

Also when I change something in geektool the text from the file is displayed over and over and over again in the entire geektool window.

Does anybody know how to fix this?

Also I wan't my weekly training plan to be displayed and updated as I get the workouts done. Is there a smart way to do this?

Did you try to put the "refresh every" to a number (in seconds)? this should work. whats your code? and your training plan... which program are you using? if its on iCal, use iCalbuddy (google it).

I'm sure this is simple I'm just a bit of a geektool noob. How do I the grey overlay like in this picture?
Empty text file, background black, transparency of like 30-40%. Cant make it easier than that! :p
 
Empty text file, background black, transparency of like 30-40%. Cant make it easier than that! :p

Thanks!

I've been trying to get a yahoo top news rss feed but everything I try isn't working. I've searched this thread and google to no avail, can anyone help?

Edit: Nevermind, got it all working.
 
It takes a couple of steps (one to retrieve the image, another one to display it and your text).

Check out my geektool set-up page for the scripts: http://www.blazingfrog.com/bf/geektool-scripts.html

Thanks very much for the Scripts! I've been able to get a couple of useful ones I was having trouble with onto my desktop! With the Track name is there any way for this to be slit over multiple lines?

Thanks :)
 
Problem with shell script display in GeekTool 3

Hi all,

I've been using GeekTool for awhile but have mostly been relying on others people's scripts. I'm a scripting noob.

I'm trying to get GeekTool to display the remaining battery percentage for my Bluetooth mouse and keyboard. Here's the script:

Code:
#!/bin/sh

myVar1=`ioreg -n "IOAppleBluetoothHIDDriver" | grep -i "batterypercent" | sed 's/[^[:digit:]]//g'`

echo "Keyboard: $myVar1%"

It works great in the terminal but displays a bunch of numbers before the percentage when I use GeekTool. Like this:

9gasrr.png


I blurred some of the numbers in case it was something significant. :eek: The numbers are the same.

Any ideas??

TIA
 
All I need to figure out is how to get my cpu processes lined up straight so it looks organized. ANYBODY KNOW HOW??

MyDesktop-1.png
 
Geektool days until?

Sorry if there's already something about this, I tried searching but to no avail. :confused:
Anyway, I was wondering if there was a geektool script I could use to count down to any day. I'm no good with geektool scripts so i dunno how to make my own :D

if you need the date, it's september 8th
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.