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.
Quotes Script

Thanks so much for your help. I am very new to mac so I'm a little lost. I followed your directions ran apple script, but get a error message that states:


File untitled:Users:twosavy:Desktop:Quotes.txt wasn’t found.

The file in on my desktop and named Quotes.txt

I also have another file with multiple quotes that I would like to run but at the present time just using one quote to see if it works, but the long run goal is to run the larger file with about 20 quotes in it..

How do you send a PM in this forum>>

The geeklet command was : osascript /Users/twosavy/Desktop/Quotes.scpt | fold -sw900

Thanks
 
I'm new to geektool, and i understand how to use php and everything, but ive been trying to adapt a countdown code from this thread, and i cant get it to work. even copying in the last one to be used here comes out with an error in the parse or whatever. I'd love if someone could post a code, saying where you enter in the date you're aiming for, and shows simply "## days, ## hours, ## minutes, and ## seconds until (target, e.g. Summer)". Any help?
 
I'm new to geektool, and i understand how to use php and everything, but ive been trying to adapt a countdown code from this thread, and i cant get it to work. even copying in the last one to be used here comes out with an error in the parse or whatever. I'd love if someone could post a code, saying where you enter in the date you're aiming for, and shows simply "## days, ## hours, ## minutes, and ## seconds until (target, e.g. Summer)". Any help?

http://code.google.com/p/xtacocorex-geektool-scripts/wiki/DateCountdownHowTo
 
sorry, but i tried it. dont understand how to do it. can anyone just give me a code for the command script or a php code?

Ok, try these command lines. It's a days until... counter that I posted in some other thread, but I think that the math to generate the additional h:mm:ss details in the output shouldn't be too hard to work out. The example below is Valentines' Day 2012

Code:
THEN=`date -v12y -v14d -v2m +%s`
SECS=$(($THEN-$(date +%s)))
echo "Days: "$(($SECS/3600/24))
 
sorry, but i tried it. dont understand how to do it. can anyone just give me a code for the command script or a php code?

Just curious, but what don't you understand about the script? Feedback like that would make it better for everybody and would help me update the script.
 
Weird Characters

On the command line:
Code:
ruby -e 'x = ARGF.to_a; puts x[rand x.size]' [I]somefile.txt[/I]

Or if you prefer a script:
Code:
#!/usr/bin/ruby

x = ARGF.to_a

puts x[rand x.size]

And run the script with somefile.txt as an argument.

Sometimes it displays the text fine, but sometimes it displays things like "colortbl;;red255;green255;blue255" and just strings of characters and numbers, etc. I don't understand why this happens.
I'm using a GeekTool Shell for this, and I really just want to display random lines of text from a .txt file. Barely anything I've found works. Help?
 
Sometimes it displays the text fine, but sometimes it displays things like "colortbl;;red255;green255;blue255" and just strings of characters and numbers, etc. I don't understand why this happens.
I'm using a GeekTool Shell for this, and I really just want to display random lines of text from a .txt file. Barely anything I've found works. Help?

What do the contents of somefile.txt look like? It looks as though it wants to display colors. You could try turning on the colorize option in Geektools, that might alleviate the problem too.
 
hey guys i'm trying to get my itunes albumart to show on the desktop.

BUT i cant seem to get the script working. what info do i need to change?

here's my script:

Code:
-- Paths and stuff
set ArtworkFromiTunes to ((path to home folder) as text) & ¬
	"Pictures:iTunesArtwork:From iTunes:albumArt.pict" as alias
set iTunesArtwork to ((path to home folder) as text) & ¬
	"Pictures:iTunesArtwork:From iTunes:albumArt.pict"
set DefaultArtwork to ((path to home folder) as text) & ¬
	"Pictures:iTunesArtwork:Default:albumArt.pict"
set displayArtwork to ((path to home folder) as text) & ¬
	"Pictures:iTunesArtwork:albumArt.pict"

-- Unix versions of the above path strings
set unixITunesArtwork to the quoted form of POSIX path of iTunesArtwork
set unixDefaultArtwork to the quoted form of POSIX path of DefaultArtwork
set unixDisplayArtwork to the quoted form of POSIX path of displayArtwork

set whichArt to "blank"
tell application "System Events"
	if exists process "iTunes" then -- iTunes is running
		tell application "iTunes"
			if player state is playing then -- iTunes is playing
				set aLibrary to name of current playlist -- Name of Current Playlist
				set aTrack to current track
				set aTrackArtwork to null
				if (count of artwork of aTrack) ≥ 1 then -- there's an album cover
					"Running and playing and art"
					set aTrackArtwork to data of artwork 1 of aTrack
					set fileRef to ¬
						(open for access ArtworkFromiTunes with write permission)
					try
						set eof fileRef to 512
						write aTrackArtwork to fileRef starting at 513
						close access fileRef
					on error errorMsg
						try
							close access fileRef
						end try
						error errorMsg
					end try
					
					tell application "Finder" to ¬
						set creator type of ArtworkFromiTunes to "????"
					set whichArt to "iTunes"
				end if
			end if
		end tell
	end if
end tell

if whichArt is "iTunes" then
	do shell script "ditto -rsrc " & unixITunesArtwork & space & unixDisplayArtwork
else
	do shell script "ditto -rsrc " & unixDefaultArtwork & space & unixDisplayArtwork
end if

when i run the script in Applescript editor this error comes out:

error "File Macintosh HD:Users:bong:pictures:iTunesArtwork:From iTunes:albumArt.pict wasn’t found." number -43 from "Macintosh HD:Users:bong:pictures:iTunesArtwork:From iTunes:albumArt.pict"

Did you figured that one out? Cause I have the same issue...
It's not that big of a deal to have iTunes artwork on the desktop, but now, I just want to understand why it's not working... It's a personal thing now :)
 
Hey guys, I would like to share my desktop with you :)

I collected some scripts from this thread like this one here

http://cl.ly/0v0T0V0R3G3m181j2m3Q

for the battery images and status.

It's awesome how people share their knowledge here :)

At this point a big thanks to all of you who made such awesome scripts to let my desktop look unique

Bildschirmfoto 2012-02-06 um 13.59.13.jpg
Bildschirmfoto 2012-02-06 um 15.47.09.jpg

The battery images are made by myself, I can upload it if some of you are interested in.
The font I use is Stonehange, google it :)

I also tried to use the same font for the calendar bar, but its not possible, because its not a fixed-width font.

The picture is the old town of Zadar, Croatia, taken from the highest point in old town.

Let me know if you like my style :D
 
URGENT: Error in Automatic Location Grabbing

URGENT!

Can anyone who is using my scripts that have automatic location grabbing confirm that the scripts are not working?

I'm having issues getting to http://ipinfodb.com/my_ip_location.php in the browser and my scripts that use the location information from there are stalling in the urllib.urlopen() call.

I don't have a fix or workaround just yet if you are affected.

I was pointed to another location grabbing service by justwright but I cannot parse the IP data from the site, it's hidden in the source when you inspect the page. If anyone can figure it out, please let me know by PM. The url is http://ipfingerprints.com/geolocation.php
 
URGENT!

Can anyone who is using my scripts that have automatic location grabbing confirm that the scripts are not working?

I'm having issues getting to http://ipinfodb.com/my_ip_location.php in the browser and my scripts that use the location information from there are stalling in the urllib.urlopen() call.

I don't have a fix or workaround just yet if you are affected.

I was pointed to another location grabbing service by justwright but I cannot parse the IP data from the site, it's hidden in the source when you inspect the page. If anyone can figure it out, please let me know by PM. The url is http://ipfingerprints.com/geolocation.php

Disregard. It's working again for me, so I must have had an internet fart on my end. Thankfully my tax refund should be here soon and I can get a new DSL modem, router, and wifi setup all in one.
 
Hi, really new to geektool and not really coding guy either but managed to get som simple stuff going on the desktop and really started to like geektool.

Now i am trying to get some info about AS Roma from some page and post it on the desktop. I was wondering if its possible to get the content from a div on a page in any way? Interested in getting the info in "latest results and fixtures" from http://www.footbo.com/Teams/A.S._Roma.

Got info from div to my weather scripts but not really sure how it works. Anyone smarter than me out there that could help?
 
Urgent help needed

My frustration level is at the max. I am new to Geek tool and I am trying to create my own person QUOTE of the day. I have tried everything that I could find on the net and I still :mad::mad: have no clue how to write a geeklet to show my quotes. My quotes are in a txt file called Quotes.txt.

Can anybody PLEASE help me with a script to use. I know it's real simple but my simple mind cannot figure it out.

HELP PLEASE
 
Help please!

My goal is to have geektool display a different (specific) file on different days.

For example: On monday, display monday.txt. On Tuesday, display Tuesday.txt, etc.

I'm thinking this can either be done in one geeklet, or having multiple geeklets that will only show up on certain days.

Is this possible?

Thank you in advance for any advice/guidance.
 
My goal is to have geektool display a different (specific) file on different days.

For example: On monday, display monday.txt. On Tuesday, display Tuesday.txt, etc.

I'm thinking this can either be done in one geeklet, or having multiple geeklets that will only show up on certain days.

Is this possible?

Thank you in advance for any advice/guidance.
it's not pretty, but my first try would be to work with iCal and iCalBuddy. You make events (recurring ones if needed) and you write what's in your txt file in the note section.
Else than that, no idea.
 
My frustration level is at the max. I am new to Geek tool and I am trying to create my own person QUOTE of the day. I have tried everything that I could find on the net and I still :mad::mad: have no clue how to write a geeklet to show my quotes. My quotes are in a txt file called Quotes.txt.

Can anybody PLEASE help me with a script to use. I know it's real simple but my simple mind cannot figure it out.

HELP PLEASE

If you're having issues, it helps if you post the script you're trying to use in code brackets in a post. We have no idea what you're trying to run. The code that brenm666 posted does have issues, I just verified that.

Try this:
Code:
set newline to ASCII character 10
set quoteFile to POSIX file "/Users/<username>/path/to/file/quotes.txt"
open for access quoteFile
set quoteList to every paragraph of (read quoteFile)
set list_count to the count of quoteList
set pick to random number from 1 to list_count
set finalText to item pick of quoteList as string
close access quoteFile
finalText

How to modify to your directory structure:
1. Replace <username> with your username
2. Replace /path/to/file/ with the path to the file after your username
3. If your quotes file is actually Quotes.txt, make the Q uppercase since the system is case-sensitive

I've tested this in the Applescript editor and it should work.
 
Error message

Here is the error message I am getting:

Apple Script error
error "An error of type -1409 has occurred." number -1409 from file "Macintosh HD:Users:twosavy:Desktop:Quotes.txt:"

Geeklet : osascript /Users/twosavy/Desktop/Quotes.txt | fold -sw900

set newline to ASCII character 10
set quoteFile to POSIX file "/Users/twosavy/Desktop/Quotes.txt"
open for access quoteFile
set quoteList to every paragraph of (read quoteFile)
set list_count to the count of quoteList
set pick to random number from 1 to list_count
set finalText to item pick of quoteList as string
close access quoteFile
finalText

I ran the AS with just 1 quote and it worked, when I changed the file to the file with all the quotes and ran I got the AS error above.


Should I change the file name with the quotes to something different??
 
Last edited:
Quotes

I guess I should also say that I have about 25 quotes that I want to run at a random pick from the file. This AS only seems to work on 1 quotes or I am not doing something right. I made a new desktop folder calle Scripts and a sub folder called quotes and inside quotes are just 2 quotes for testing.

Here is the codes that run just one quote with no AS errors:


set newline to ASCII character 10
set quoteFile to POSIX file "/Users/twosavy/Desktop/Scripts/quotes/test.txt"
open for access quoteFile
set quoteList to every paragraph of (read quoteFile)
set list_count to the count of quoteList
set pick to random number from 1 to list_count
set finalText to item pick of quoteList as string
close access quoteFile
finalText


Geek code: osascript /Users/twosavy/Desktop/Scripts/quotes/test.txt| fold -sw900
 
Here is the error message I am getting:

Apple Script error
error "An error of type -1409 has occurred." number -1409 from file "Macintosh HD:Users:twosavy:Desktop:Quotes.txt:"

Geeklet : osascript /Users/twosavy/Desktop/Quotes.txt | fold -sw900

set newline to ASCII character 10
set quoteFile to POSIX file "/Users/twosavy/Desktop/Quotes.txt"
open for access quoteFile
set quoteList to every paragraph of (read quoteFile)
set list_count to the count of quoteList
set pick to random number from 1 to list_count
set finalText to item pick of quoteList as string
close access quoteFile
finalText

I ran the AS with just 1 quote and it worked, when I changed the file to the file with all the quotes and ran I got the AS error above.


Should I change the file name with the quotes to something different??

It also helps if you quote, then the people helping know when you respond. :)

You need to save the script with a .scpt extension from the Applescript Editor. Have you tried running the code in there first to make sure it works?

In Geektool, you're trying to call the Quote.txt file in your osascript command. I'm assuming Quote.txt has your quotes in it.

Here is the quote file I tested with:
Code:
hello
this is a quote file
howdy do
phineas and ferb
perry the platapus

Like I said, please use the code blocks, it makes it easier to read through code. Please verify that you are running actual Applescript in the osascript call instead of quotes.

With the script I posted before, I am able to call it with the osascript command in Terminal.app and have it run properly. You don't need the pipe command at the end, you can just call the script directly.
Code:
osascript /path/to/script/randomquote.scpt
 
???

I have to say I am sorry I am new to MAC and don't really understand all its working yet. I don't know what you mean by QUOTE then people know how to respond.

I have Apple Script open and there are only 4 files type to save it as, SCRIPT, SCRIPT BUNDLE, APPLICATION AND TEXT. I am saving it as a SCRIPT.

COMPILE then RUN is that correct way to do it?

Here is the script file"
set newline to ASCII character 10
set quoteFile to POSIX file "/Users/twosavy/Desktop/Scripts/quotes.txt"
open for access quoteFile
set quoteList to every paragraph of (read quoteFile)
set list_count to the count of quoteList
set pick to random number from 1 to list_count
set finalText to item pick of quoteList as string
close access quoteFile
finalText"


If I run this command:
set quoteFile to POSIX file "/Users/twosavy/Desktop/Scripts/quotes/test.txt"
the AS works with just 1 quote.

The quotes are in a folder on the desktop called SCRIPTS. Within Scripts is a sub folder called quotes and with in the subfolder are the quotes saved as a txt file.

if I run this command:set quoteFile to POSIX file"/Users/twosavy/Desktop/Scripts/quotes.txt"

I get a error message that say's: Syntax Error
error "End of file error." number -39 from file "Macintosh HD:Users:twosavy:Desktop:Scripts:quotes.txt"


What name do I save the file as I was using "UNTITLED".

I guess I really don't know what the script command should be.

Should the quote file be called quotes.txt when it is subfolder in the AS line???

So I am really lost here.
 
Found my Mistakes

Well it took a restless night of no sleep to finally figure put what I was doing wrong, it was just a non thought stupid mistake of not saving the AS to the right name. Thank you for all your help. Now I am not used to Geek tools from coming over from rainmeter but here is a simple rainmeter script that I would like to use but don't really k now how to convert it to a Geeklet: The rainmeter script is:

;------------------------------------------------------------------------------------------------
; ENIGMA RAIN (I)
; Class: Icon

[Rainmeter]
Author=Kaelri.LCD@gmail.com
AppVersion=1001000
Update=100
MiddleMouseDownAction=!RainmeterActivateConfig #CURRENTCONFIG# Rain.ini

[Variables]
@include=#SKINSPATH#Enigma\Resources\Variables\UserVariables.inc
Description=Rainmeter. :)
Instructions=Set your Weather Code to show your local rainfall. | Look up Yahoo! Weather codes at (http://weather.yahoo.com).
Version=2.7
Tags=Taskbar | Yahoo! Weather
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Preview=#SKINSPATH#Enigma\Resources\Images\Preview.png
Variant=2

[Variables]
@include=#SKINSPATH#Enigma\Resources\Variables\UserVariables.inc

;------------------------------------------------------------------------------------------------
; MEASURES

[MeasureRain]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
;Url=http://www.weather.com/outlook/travel/businesstraveler/local/USFL0378
;RegExp="(?siU)Precip:.*align=\"left\">(.*)%"
Url=http://xhtml.weather.com/xhtml/hbhf/USFL0378
RegExp="Precip:[\n\s]*([0-9]*.*)%"
StringIndex=1

;------------------------------------------------------------------------------------------------

[MeterName]
Meter=String
FontFace=NEUROPOL
; METERS

[Icon]
Meter=IMAGE
ImageName=3.png
X=-5
Y=0
W=45
H=45

[Label]
Meter=STRING
X=45
Y=1
H=10
W=20
FontColor=00f0ff
FontFace=NEUROPOL
FontSize=11
StringAlign=LEFT
StringStyle=BOLD
AntiAlias=1
Text="Rain"
AntiAlias=1

[Label2]
Meter=STRING
MeasureName=MeasureRain
X=r
Y=20r
H=60
W=60
FontColor=00f0ff
FontFace=NEUROPOL
FontSize=11
StringAlign=LEFT
StringStyle=BOLD
AntiAlias=1
AutoScale=1
NumOfDecimals=0
Text="%1%"


This is a simple icon with tell you the % of rain for the day.

Any thoughts???
 
New error

How do I break up a long quote? When it shows up in the geeklet it's one continious line;

Here is the quote:

"After the press of year-end business and the excitement of the holidays, a person's thoughts turn to taking a little mid-winter break. In short, it's time to chill out. :)"

I tried to edit it and do a return so it breaks @BUSINESS and when you refresh the geeklet just refreshes to the next line of:
After the press of year-end business then the next line
and the excitement of the holidays, a ect, ect
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.