Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / General / General / September 2008



Tip: Looking for answers? Try searching our database.

Very simple script didn't work in iCal

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jamie Kahn Genet - 08 Sep 2008 03:48 GMT
"tell application "Transmission"
    quit
end tell"

Any idea why? It works when run in Script Editor.

TIA,
Jamie Kahn Genet
Signature

If you're not part of the solution, you're part of the precipitate.

Dave Balderstone - 08 Sep 2008 13:59 GMT
> "tell application "Transmission"
>      quit
> end tell"
>
> Any idea why? It works when run in Script Editor.

Did you save it as an application, compiled script, ???

Signature

I kill all messages, and replies to messages, from Google Groups. See
http://improve-usenet.org for details.

Jamie Kahn Genet - 08 Sep 2008 15:37 GMT
> > "tell application "Transmission"
> >      quit
[quoted text clipped - 3 lines]
>
> Did you save it as an application, compiled script, ???

Just a script. It's companion launch Transmission script ran ok in iCal.
Signature

If you're not part of the solution, you're part of the precipitate.

Dave Balderstone - 08 Sep 2008 16:08 GMT
> > > "tell application "Transmission"
> > >      quit
[quoted text clipped - 5 lines]
>
> Just a script. It's companion launch Transmission script ran ok in iCal.

Try this:

try
tell application "Transmission"
    quit
on error TheErr
display dialog "Transmission didn't quite because " & TheErr
end tell
end try

And report back if it throws an error message.

Signature

I kill all messages, and replies to messages, from Google Groups. See
http://improve-usenet.org for details.

Jamie Kahn Genet - 08 Sep 2008 17:45 GMT
> > > > "tell application "Transmission"
> > > >      quit
[quoted text clipped - 17 lines]
>
> And report back if it throws an error message.

I get a syntax error trying to compile the above:

Expected "end" or "end tell" but found "on".
Signature

If you're not part of the solution, you're part of the precipitate.

Dave Balderstone - 08 Sep 2008 17:48 GMT
> I get a syntax error trying to compile the above:
>
> Expected "end" or "end tell" but found "on".

try
  tell application "Transmission"
     quit
  end tell
on error TheErr
  display dialog "Transmission didn't quite because " & TheErr
end try

Signature

I kill all messages, and replies to messages, from Google Groups. See
http://improve-usenet.org for details.

Jamie Kahn Genet - 08 Sep 2008 18:25 GMT
> > I get a syntax error trying to compile the above:
> >
[quoted text clipped - 7 lines]
>    display dialog "Transmission didn't quite because " & TheErr
> end try

I now get:

Expected function name, command name or function name but found "error".
Signature

If you're not part of the solution, you're part of the precipitate.

Dave Balderstone - 08 Sep 2008 18:51 GMT
> > > I get a syntax error trying to compile the above:
> > >
[quoted text clipped - 11 lines]
>
> Expected function name, command name or function name but found "error".

It compiles and runs without error here. What line highlighted when you
see the error message?

Signature

I kill all messages, and replies to messages, from Google Groups. See
http://improve-usenet.org for details.

Jolly Roger - 09 Sep 2008 00:52 GMT
> > > I get a syntax error trying to compile the above:
> > >
[quoted text clipped - 11 lines]
>
> Expected function name, command name or function name but found "error".

"on error" is a continuation of the "try" statement.
Did you omit the "try" statement at the beginning, perhaps?

Signature

Send responses to the relevant news group rather than to me, as
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.

JR

Dave Balderstone - 09 Sep 2008 02:19 GMT
> > > > I get a syntax error trying to compile the above:
> > > >
[quoted text clipped - 14 lines]
> "on error" is a continuation of the "try" statement.
> Did you omit the "try" statement at the beginning, perhaps?

Good catch, JR. I didn't think of the possibility he may have
interpreted "try" as an instruction from me, rather than part of the
script.

Signature

I kill all messages, and replies to messages, from Google Groups. See
http://improve-usenet.org for details.

Jolly Roger - 09 Sep 2008 03:45 GMT
> > > > > I get a syntax error trying to compile the above:
> > > > >
[quoted text clipped - 18 lines]
> interpreted "try" as an instruction from me, rather than part of the
> script.

I wonder...

BTW, to combat this very thing, I usually try to wrap scripts I post online with:

-- begin script
-- end script

Signature

Please send all responses to the relevant news group rather than directly
to me, as E-mail sent to this address may be devoured by my very hungry
SPAM filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google Groups.
You'll need to use a real news reader if you want me to see your posts.

JR

Jamie Kahn Genet - 09 Sep 2008 05:14 GMT
> > > > > I get a syntax error trying to compile the above:
> > > > >
[quoted text clipped - 18 lines]
> interpreted "try" as an instruction from me, rather than part of the
> script.

That was it, heh. Well I feel stupid :-D It was early in the morning and
I just wasn't catching the closing statement which of course requires an
opening statement... I just cannot adequately explain how my brain works
some days... and I use 'works' loosely... I just kept seeing 'try' as an
instruction from Dave *headdesk*

Thank you both. I have to go hide now till the embarrassment passes.
Signature

If you're not part of the solution, you're part of the precipitate.

Jolly Roger - 09 Sep 2008 14:38 GMT
> > > > > > I get a syntax error trying to compile the above:
> > > > > >
[quoted text clipped - 26 lines]
>
> Thank you both. I have to go hide now till the embarrassment passes.

It happens - no worries!  : )

Signature

Send responses to the relevant news group rather than to me, as
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.

JR

Simon Slavin - 10 Sep 2008 22:13 GMT
On 09/09/2008, Jamie Kahn Genet wrote in message
<1imzj2c.1tv61fc14pflreN%jamiekg@wizardling.geek.nz>:

> > try
> >    tell application "Transmission"
[quoted text clipped - 7 lines]
>
> Expected function name, command name or function name but found "error".

Put 'on run' as a line before the first line and 'end run' after the last
line.

I actually suspect that you have a weird non-seeable character or some
other weird formatting somewhere in the script which is stopping it
compiling correctly.

Simon.
Signature

http://www.hearsay.demon.co.uk

Jolly Roger - 10 Sep 2008 23:27 GMT
In article <ga9flb$180$2$8300dec7@news.demon.co.uk>,
Simon Slavin <slavins.delete.these.four.words@hearsay.demon.co.uk>
wrote:

> On 09/09/2008, Jamie Kahn Genet wrote in message
> <1imzj2c.1tv61fc14pflreN%jamiekg@wizardling.geek.nz>:
[quoted text clipped - 13 lines]
> Put 'on run' as a line before the first line and 'end run' after the last
> line.

That won't fix the problem though.

> I actually suspect that you have a weird non-seeable character or some
> other weird formatting somewhere in the script which is stopping it
> compiling correctly.

Nope. Read the rest of the thread.   ; )

Signature

Send responses to the relevant news group rather than to me, as
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.

JR

Simon Slavin - 13 Sep 2008 21:32 GMT
On 10/09/2008, Jolly Roger wrote in message <jollyroger-
F05D98.17271010092008@news.individual.net>:

>  Simon Slavin <slavins.delete.these.four.words@hearsay.demon.co.uk>
>  wrote:
[quoted text clipped - 3 lines]
>
> That won't fix the problem though.

If changes the context of those lines of script from being part of the
application that's running it, to being a stand-alone script.  This means
that error messages are reported to the user better.

Simon.
Signature

http://www.hearsay.demon.co.uk

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.