MACSCRPT Archives

February 2011

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Deivy Petrescu <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 23 Feb 2011 17:45:25 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (44 lines)
Brian,
There is one thing that you have to keep in mind with AppleScripts scripts, a compiled script shows you English phrases but it is a bunch of appleevents that applications can send and receive.
What I mean is the following, the fact that the same commands are in the script and in iTunes dictionary does not mean that they are indeed the same command. 
So, say your app has an class "a" it might have the raw appleevent as «class tica» a newer version of this app has the same class, but the appleevent now is   «class ticb». 

So, you save your script with the old app, it reads

tell app to set x to  a

it saves it as
set x to class tica

in the new app you would read

tell app a to set x to a
set x to class ticb

The work around is to save your scripts as text and then compile it in the machine it will reside, or,
use "using terms from application" when writing the script. 

I've learned this playing with Excel ... same terminology, different apple events.


On Jan 21, 2011, at 11:02 PM, Brian Johnson wrote:

> I've got a bit of a problem .... and since context may matter here ....
> 
> Context:  G5 dual running 10.5 and Personal Web Sharing, plus my "peacePipe" (apache <-> applescript) software. The G5 is new to me, but the rest was ported from an older PPC box, running 10.4 to I could keep an OS-9 app or two around. Newish MacBook adds the SnowLeopard footprints.
> 
> peacePipe works by configuring apache to channel "cgi-bin/name.acgi" requests to a shell script that uses a inter-process pipe and osascript to execute the "handle cgi request" of name.acgi in a world where there's a window-manager. The script then runs, returning output back through the same pipeline. This setup is stable for several years, and is certainly working on the server in question.
> 
> What is NOT working is a script that used to let you control iTunes (on the server) from a web-browser. When I opened it (in ScriptEditor) on the server (10.5..) a bunch of the iTunes vocabulary seemed to be unrecognized (e.g. "player state"), even though the iTunes dictionary on the same machine shows the info. So I can't fix it there (it seems).
> 
> So, I brought a copy of the script home, where my 10.6 laptop opened it fine, binds to the iTunes dictionary fine, and (with one fix) actually runs the script fine as long as I run it in SE and hand-code the incoming "POST" commands. Peachy, except I can't save it to a format (script bundle or application) that works on the server. If I copy it as an .app and rename it, it turns into a folder and apache says "access forbidden". If I rename it first, it looks ok under 10.6 but "turns into" a folder when copied to the 10.5 server. If it isn't named .acgi, peacePipe won't get the POST data from apache.
> 
> This script is a toy, so I could toss it without pain, but I've got several other applications that I don't want to lose just because I have to make a tweak (they run now). 
> 
> Am I missing something? or am I really sitting 'twixt the proverbial rock and hard place? (and, yes, I know this question sort of goes back 4-5 years ... call me a slow learner...)
> 
>  -Brian Johnson 

Deivy Petrescu
[log in to unmask]

ATOM RSS1 RSS2