Re: Running a shell script via applescript on a remote station?
Re: Running a shell script via applescript on a remote station?
- Subject: Re: Running a shell script via applescript on a remote station?
- From: Axel Luttgens <email@hidden>
- Date: Sat, 1 Nov 2008 13:27:09 +0100
Le 1 nov. 08 à 08:37, Patrik B. a écrit :
Hi,
I am working on making the below script work (an image converter via
xgrid). However I am running into not being able to spawn the
applescript on my remote machine any ideas? (I have WishTCL
What's that? And why was it needed? On which box? Doesn't it interfere
with OSX's tcl?
installed as well as the OSAXplug in,
Should we suppose you're speaking about Satimage's XML addition?
and the xgrid has a dedicated machine with Xgrid running on it.
As a controller? As an agent?
I can see the job being submitted all right via the Xgrid controller
and it even "succeeds" but no converted image turns up.
Nothing in the logs?
Nor do I see the script actually running on the xgrid machine.
Do you mean an agent?
I beleave the problems lies in spawning the script on the remote
machine.
Assuming the "remote machine" is the agent, nothing in its logs?
And which script? xgridscript? Or xgridapplescript? They are very
differing beasts...
Any suggestions on the code below.
This is mostly based on the below blog.
http://jw-digital.net/blog/archives/2006/02/photoshop_xgrid.html
Hmmm... this was probably on Tiger.
Not sure, but some architectural changes (format of the plists,
sandboxing, connections to the Window server...) may have happend
since; are you trying this under Leopard?
More generally, if you want us to be of some help, could you try to
reduce your question to its basics?
For example, instead of posting here general-purpose scripts
generating scripts that get somehow executed, it would be far easier
for everybody, you included, to start with a real job, even if it
handles a fixed pair of input/output files?
Have you even tested your grid with something very simple (see the man
page of xgrid(1) for an example)?
Currently, we must:
- guess about your environment (OS, file server...)
- guess about your grid configuration (controller, agents, clients)
- accept that your grid is otherwise functional
- try to understand script-generating scripts
- guess about the failures (no logs, no error messages provided)
As far as AppleScript is concerned, I would first try to execute by
hand something like this:
ssh xgrid@127.0.0.1 "osascript -e 'tell application "Adobe Photoshop
CS3" to get name'"
If that works, try with a variant, for example:
ssh xgrid@127.0.0.1 "osascript /path/to/simplexgridapplescript"
where simplexgridapplescript would contain something like this:
tell application "Adobe Photoshop CS3"
open alias "path:to:inputfile" showing dialogs never
set myDoc to index of current document
set myResult to save document myDoc as TIFF in alias
"path:to:outputfolder"
close myResult saving no
end tell
If that works too, then try to run it *as is* as an xgrid job.
And so on.
Best, Patrik
--- this is the droplet script to submit images
[...]
set scripttext to "xgrid -h localhost -job batch " & POSIX path
of "G5_1:Users:xgrid1:Desktop:Outputlist:batch_out.plist"
So, the box on which this droplet is invoked/run is an xgrid controller?
At this stage of investigations, the contents of batch_out.plist is
what matters.
[...]
--------- this is the text of the shell script that the above
droplet calls and that should run the applescript on my remote
machine but does not
Is this RAWProcess-XGrid.sh?
[...]
mount volume "/Volumes/100.10.10.18"
Does this one really work?!?
[...]
' > /tmp/xgridapplescript
Again, a real xgridapplescript file (as generated by a run of your
script) would be far more interesting for now on.
[...]
echo '#!/usr/bin/expect
spawn ssh xgrid@127.0.0.1 "/bin/hostname; osascript /tmp/
xgridapplescript"
expect {
"continue*" {
send -- "yes\r"
expect {
"assword*" {
send -- "xgrid\r"
interact
}
}
}
"assword*" {
send -- "xgrid\r"
interact
}
}' > /tmp/xgridscript
chmod 700 /tmp/xgridscript
/tmp/xgridscript $3
Perhaps could you add this instruction here:
logger "xgridscript ended with code: $?"
rm /tmp/xgridscript
rm /tmp/xgridapplescript
For debugging, don't delete xgridscript and xgridapplescript!
We need them!
echo "---"
# end of script
------- this is the "batch_out.plist" file that the droplet script
above calls for. and that basically gets submitted when the xgrid
job gets submitted.
[...]
Are you sure this is not "batch_template.plist" instead?
Could you show us a real "batch_out.plist" file, as generated by the
droplet? _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden