Author Topic: Need Mac Guru  (Read 1625 times)

Offline ehowton

  • Colonel COURAGEOUS Member
  • *********
  • Posts: 7595
  • Fingering the Muse
    • http://ehowton.livejournal.com
Re: Need Mac Guru
« Reply #45 on: September 11, 2009, 10:49:38 PM »
Two ways, dependent upon where you are:

If you're in the directory you're script is in, you precede the script with a ./

If you're outside the directory, you simply type its full path.

BUT!  My applescript worked with your syntax with one difference - replace your colons with a slash /

Offline ehowton

  • Colonel COURAGEOUS Member
  • *********
  • Posts: 7595
  • Fingering the Muse
    • http://ehowton.livejournal.com
Re: Need Mac Guru
« Reply #46 on: September 11, 2009, 10:50:58 PM »
do shell script "openhd:users:myusername:unixstuff:scripts:getweather.sh"

do shell script "/openhd/users/myusername/unixstuff/scripts/getweather.sh"

Offline filmnazi

  • Full Member
  • ***
  • Posts: 142
  • libertarian whipping boy
Re: Need Mac Guru
« Reply #47 on: September 11, 2009, 11:13:32 PM »
do shell script "/openhd/users/myusername/unixstuff/scripts/getweather.sh"

Ok that is odd.  getweather.sh runs fine in terminal, but if I change from : to / in the applescript path I get a no such file or directory error.  It's odd that it works from your applescript as I believe the : is the standard in applescript land.  With the :'s I get the error message: sh: :openhd:shellscripts:getweather.sh: command not found

Offline ehowton

  • Colonel COURAGEOUS Member
  • *********
  • Posts: 7595
  • Fingering the Muse
    • http://ehowton.livejournal.com
Re: Need Mac Guru
« Reply #48 on: September 11, 2009, 11:31:24 PM »
Go into the directory getweather.sh resides and type

pwd

replace what's in the quote on the applescript with what returns.

Let's make sure it can find the shell script.

Offline filmnazi

  • Full Member
  • ***
  • Posts: 142
  • libertarian whipping boy
Re: Need Mac Guru
« Reply #49 on: September 11, 2009, 11:47:47 PM »
OK, I added the full path to the command wget like so /sw/bin/wget and now the script runs.  In terminal it rights the .txt file in the same directory as the .sh file, but from applescript it writes the file in the root.  go figure.

Offline ehowton

  • Colonel COURAGEOUS Member
  • *********
  • Posts: 7595
  • Fingering the Muse
    • http://ehowton.livejournal.com
Re: Need Mac Guru
« Reply #50 on: September 11, 2009, 11:51:56 PM »
Congrats!

Offline filmnazi

  • Full Member
  • ***
  • Posts: 142
  • libertarian whipping boy
Re: Need Mac Guru
« Reply #51 on: September 12, 2009, 08:39:00 AM »
Thank you so much guys! One more question, though it might be a tough one for you experts to answer because it's been so long since y'all were newbs...know any good free tutorials on shell scripting and unix in general?

Anyway, so now that i've got weather added my project is complete, though I would like to ad some news headlines and maybe some jokes from other rss feeds thus the interest in learning shell scripts.

It's an alarm clock right now, using iCal's ability to run scripts from event instances.  I can snooze, ask for the weather and i can play my favorite iTunes playlist all by speaking to my girl betty sue.  All of her responses are randomized from lists of 4 or 5 different phrases helping to make her sound like she is sassy and intelligent when really she is pretty dumb and completely devoid of sass.  I just love hearing "anything else boss?"  Feels like I'm living in a scifi novel...

Next applescript project is going to be a script to move completed torrent downloads to appropriate folders, movies, music etc.