Is it possible to pass a variable from a shell script back to an Automator action?
Is it possible to pass a variable from a shell script back to an Automator action?
For instance, if I assign a value of foo to $var1 in my shell script how would I retrieve/pass that value in the next Automator action. I see that there is a variable called "Shell Script" but I can't any information on how to use it.
red_menace,
Thanks but I still don't understand how to pass a single value that was set in the UNIX scipt back to Automator has a variable. Take the example below, I write 4 varables to STDOUT and all 4 are stored in a variable named "storage". How do I assign 1 of these values to the Automator "storage" variable? For instance if I wanted to assign the value of $var2 to "storage" , how would I do that?
Similar Messages
-
Reading variables from a shell script
i was wondering if it is possible to enter variables from a shell script that an sql file can use:
ex:
shell script file
#!/bin/ksh
stty -echo
read pwd?"Enter password for user: "
echo
stty echo
read var?"Please enter value for variable: "
echo
$ORACLE_HOME/bin/sqlplus user/$pwd @TEST.sql
sql file TEST.sql
set serveroutput on
set verify off
spool out.log
update table set parameter_value = '$var' where parameter_name = 'X';
commit;
exit;
spool off;
i tried that and it seems its updating my table with "var" and not what the user entered that is the bind variable $var
am i missing something?if user hits enter (which means null) can the program
not end and ask the user to enter another value?Try this way :
while :
do
echo -n "Please enter value for variable: "
read VAR
if [ "$VAR" ]; then
break
else
continue
fi
done -
Is it possible to pass a variable from one animation to another?
I have multiple animations on the same page. I need to pass a variable from one to the other.
Animation One has this:
sym.setVariable("myVarOne", 1);
Animation Two has this:
var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getVariable("myVarOne");
Seems like it should work, but kinda hard to tell. I put in:
console.log("myVarOneInTwo = " + myVarOneInTwo);
But I get: Javascript error in event handler! Event Type = timeline
So it seems that it doesn't like getting a variable from another animation.
Is there a way to pull a variable from one animation into another?Sorry also had to fix this:
var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getVariable("myVar One");
To this:
var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getStage().getVariable("myVar One"); -
How to pass a variable to the shell script and crontab?
Friends,
here is my script.....
exp userid=username/password@realdb file=/u02/logical_backup/abc_+$date+.dmp log=/u02/logical_backup/abc_+$date+.log owner=oraadmin statistics=none
i want the exported file name as abc_2101.dmp and abc_2101.log (2101 is a date and month)
I want to execute this script daily at 02:00 AM.
so that i edited the crontab -e as....
00 02 * * * ./u02/script/dailybkp.sh
Now what i want is....
1. is the steps are correct for crontab -e?
2. Is the script of the crontab will execute daily at 02:00 AM?
3. how can i rename the .log filename and .dmp file name daily according to the date. for example abc_2001 is today's date and month.how can i replace with the variable.
thanks
sathyguysorry....i tested with cp command it was working fine...
so, i thought it should work for exp command also.
but its not working....also its not throwing any error....
the crontab -e is having...
00 02 * * * exp userid=system/password@realdb file=/u02/test/n22.dmp log=/u02/test/n22.log owner=scott statistics=none
also i have tested by calling the script.
#!/bin/bash
00 02 * * * /u03/script/testbkp.sh
its not working
but the below one is working....
00 02 * * * cp /u02/test.txt /u02/test/test.txt
also this one is working....
#!/bin/bash
00 02 * * * /u03/script/testbkp.sh
i listed the chkconfig --list crond
crond 0,1,6 = off
2,3,4,5 are on
what might be the reason?
thanks
sathyguy -
Passing Null Characters from Unix Shell Script to Java Program
Hi Experts,
Facing an issue with a shell script....
The shell script has 10 input parameters....
1st Parameter is a compiled Java program name(This can keep changing)
Rest 9 are the parameters of the Java Program...
The following piece of code is working when Test "a z" "b t" "" "" "" "" "" "" "" "" is hardcoded.
lv_java_string=`java Test "a z" "b t" "" "" "" "" "" "" "" ""`
The whole thing being dynamic.....
But when I dynamically populate the same on to a parameter lv_java_param and then execute the same
lv_java_string=`java $lv_java_param`
if i echo $lv_java_param its giving me Test "a z" "b t" "" "" "" "" "" "" "" "" correctly
Im facing some issue...... The issue is " is being treated as a parameter itself and the space between a and z is not taken into consideration and hence z is taken as the 2nd parameter
Issue seems to be something like the precedence in which the above statement is executed, because of which "s are calculated/manipulated. Is it something like
a) $lv_java_param is computed first and then java $lv_java_param
b) or java $lv_java_param is run on the fly......
Any help is much appreciated.This forum is about Oracle *RDBMS*
I don't see any question about Oracle RDBMS
Please find a forum about Java.
Sybrand Bakker
Senior Oracle DBA -
How to pass a variable from one class to another class?
Hi,
Is it possible to pass a variable from one class to another? For e.g., I need the value of int a for calculation purpose in method doB() but I get an error <identifier> expected. What does the error mean? I know, it's a very, very simple question but once I learn this, I promise to remember it forever. Thank you.
class A {
int a;
int doA() {
a = a + 1;
return a;
class B {
int b;
A r = new A();
r.a; // error: <identifier> expected. What does that mean ?
int doB() {
int c = b/a; // error: operator / cannot be applied to a
}Thank you!elaine_g wrote:
I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
class B {
int b;
A r = new A();
r.a; //syntax error
}Why? Class definition restricts what you can define within a class to a few things:
class X {
Y y = new Y(); //defining a field -- okay
public X() { //defining a constructor -- okay
void f() { //defining a method -- okay
}... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
This is also illegal syntax:
int doB() {
A r = new A();
r.a; // error: not a statement
}Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that. -
Passing variables to a shell script
Hello all,
I have an applescript that is passing two variables to a shell script. Both variables are being passed, but the script isn't running as I would expect and I can't figure out what it's doing and why.
Here is the applescript:
delay 5
tell me to activate
display dialog "Please enter the following information."
property RoomNumber : ""
display dialog "Enter the room number and building (ie 1312CAC):" default answer RoomNumber
set the RoomNumber to text returned of the result
property StationNumber : ""
display dialog "Enter the Station Number:" default answer StationNumber
set the StationNumber to text returned of the result
do shell script ("echo " & RoomNumber & StationNumber & " | /Users/labadmin/Desktop/labbuild.sh")
and here is the shell script
#!/bin/sh
RoomNumber="$1"
StationNumber="$2"
compname=($RoomNumber$StationNumber)
scutil --set ComputerName $compname
scutil --set LocalHostName $compname
scutil --set HostName $compname
echo "Done setting the computer name"
The only name it sets is the ComputerName. LocalHost is blank and hostname is set to Localhost
Can someone see what I'm doing wrong here?
Thank you in advanced.The line
do shell script ("echo " & RoomNumber & StationNumber & " | /Users/labadmin/Desktop/labbuild.sh")
should be
do shell script ("/Users/labadmin/Desktop/labbuild.sh " & quoted form of RoomNumber & " " & quoted form of StationNumber)
In your original code, you are using echo to pass the variables to stdin of the script instead of as command-line parameters. You also don't handle the case where a value is left blank. -
Is it possible to pass a string from an applet to the web site?
Hi, everybody!
Is it possible to pass a String from an applet to a web site (as a field value in a form, an ASP variable, or anything else). Basically, I have a pretty large String that is being edited by an applet. When a user clicks on the submit button, a different page will show up which has to display the modified string. The String is pretty large so it doesn't fit into the URL variable.
Please, help!
Thank you so much!Why do you want to do this in Java?
Javascript is the correct language for these type of situations.
for instance:
in the head of your html document:
<script language=javascript type="text/javascript">
createWindow(form){
if(form.text.value!=""){
newDoc = new document
newDoc.write(form.text.value)
newWin = window.open(document,'newWin','width=200;height=150')
</script>
in the body:
<form onSubmit="createWindow(this)">
<p>
Enter a String:<input type=text size=30 name="text">
</p><p>
<input type=submit value="submit">
<input type=reset value="reset">
</p>
</form> -
Passing a variable from a non DB block to a DB block
Im getting the error FRM-41003 when I try to pass a variable from a search screen i created to a results screen which is tied to a DB block. Ive searched this error and nothing seemed to match exactly what Im dealing with. Is it possible to do this? Anybody run into this issue?
This is the code/trigger launched when the search button is clicked from the search screen that is not tied to a DB block.
IF :NRHR1.NUMBER IS NULL THEN
Message('Please enter valid search criteria.', NO_ACKNOWLEDGE);
ELSE
:Global.BUFFER_VARIABLE := :NRHR1.NUMBER;
NUM_SEARCH;
END IF;
--This is the procedure that is called
PROCEDURE NUM_SEARCH IS
BEGIN
IF :NRHR1.NUMBER IS NOT NULL THEN
:Global.BUFFER_VARIABLE := :NRHR1.NUMBER;
ENTER_QUERY;
:NRHR.NUMBER := :Global.BUFFER_VARIABLE;
DECLARE
blk_id BLOCK;
s_old_order_by VARCHAR(100);
s_old_where VARCHAR(100);
BEGIN
blk_id := FIND_BLOCK( 'NRHR' );
s_old_where := GET_BLOCK_PROPERTY(blk_id, DEFAULT_WHERE);
SET_BLOCK_PROPERTY( blk_id, DEFAULT_WHERE, 'NRHR.NUMBER = ''' ||:Global.BUFFER_VARIABLE||'''');
EXECUTE_QUERY;
SHOW_WINDOW('WINDOW1');
SET_BLOCK_PROPERTY(blk_id, DEFAULT_WHERE, s_old_where);
END;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND OR VALUE_ERROR THEN
MESSAGE('NO RECORDS');
HIDE_WINDOW('WINDOW1');
SHOW_WINDOW('SEARCH');
END;
I am using forms 10g
Edited by: user8606340 on Jan 28, 2010 8:17 AM -
LoadVars-using send to pass a variable from flash to php
For the life of me, I've tried everything:
I've researched LoadVars on Adobe forum, used David Powers'
books, googled 'flash to php', LoadVars, etc. and tried
sendAndLoad, send, and using $_POST, $_GET, $_REQUEST.
$HTTP_POSTVARS but I keep getting this same error. any advice
please?
I have a Unix server running Apache/PHP 4 - LoadVars worked
to load name-value pairs into an array -see thread)
My goal with this simple app is to prototype being able to
pass a variable from flash to a variable in php.
Parse error: syntax error, unexpected T_VARIABLE in
flash_to_SQL.php on line 5
Actionscript 2.0 code:
var c :LoadVars = new LoadVars();
c.testing = "123FOUR";
c.send ("
http://127.0.0.1/flash_to_SQL.php","_self","POST");
php code: (I also tried $_POST, $_GET, $_REQUEST.
$HTTP_POSTVARS)
<?php
//mysql 4.1.2, php 4 , NO mysqli
ecbo $_REQUEST ['testing'];
/?>var formData:LoadVars = new LoadVars();
formData.fname = "Name";
formData.send("
http://www.website.com/flash_php.php",
formData, "POST");
<?php
$name = $_POST['fname'];
echo $name;
?> -
Passing a variable from a movie clip to the main timeline
Hi,
I'm having trouble passing a variable from a movie clip in my
flash file to the main timeline.
I have a movieclip with the instance name IntroNav which
contains several buttons. Clicking a button sets the variable
"page" to a specific name, i.e. page = "home"
However, outside of the movie clip, on the main timeline I am
unable to call this variable, and "page" seems to have no value.
Can anyone tell me why this is and how to solve it?
ThanksUmm, yes ... declare your variables correctly.
var page:String = new String(); //proper complete
var page:String; //strict typing
var page:String = "home"; //stirct typing with value
declaration
Do not declare the variable in your buttons, you would have
to do so in every button and be constantly resetting the value.
Declare it on the main timeline at the lowest level. You do not
need to use it as a _global, you just need to resolve your path
issues. You can 'set' the variable value from a button, without any
problem, but you have to call to the variable correctly.
You do not 'name' a variable as "_root.page" , the '_root'
refers to the lowest level of the SWF or the main timeline, as does
a call to ' _level0' (that's a zero). If the variable is declared
on the main timeline, and you're calling from the MC/button or
anywhere you can refer to the variable by calling to it by
the proper path of '_root.page'
To set the variable from any of your button/MC instances
call:
_root.page = "value"; OR _level0.page = "value";
But you must have the varibale declared on the main timeline,
and only once and the playhead should be stopped or it will reset
the value to the default upon looping. -
How to pass a variable from HTML to Flash
I have built my flash ad banner in Flash 9 and now want the
HTML code to pass the url over to the flash movie that it should
jump to when clicked.
The info in the help file seems out of date for the latest
HTML template as it uses mainly JavaScript to get round IE's
dreadful embeding issue. So my problem is, how do I pass a variable
from the HTML to the actionScript specified int he Help file
(running on a full screen button) as shown below?
myButton_btn.onRelease = function() {
if (clickTAG.substr(0, 5) == "http:") {
getURL(clickTAG);
via the html code now used by Flash 9 which is like this:
<!-- saved from url=(0013)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Advert_long</title>
<script language="javascript"> AC_FL_RunContent = 0;
</script>
<script language="javascript"> DetectFlashVer = 0;
</script>
<script src="AC_RunActiveContent.js"
language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 115;
// -->
</script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
Coping
with
Growing
Audio
Series
Theraputic stories
for children aged
4 to 9
-->
<script language="JavaScript" type="text/javascript">
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion,
requiredMinorVersion, requiredRevision);
if(hasRightVersion) { // if we've detected an acceptable
version
// embed the flash movie
AC_FL_RunContent(
'codebase', '
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
'width', '120',
'height', '600',
'src', 'Advert_long',
'quality', 'high',
'pluginspage', '
http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Advert_long',
'bgcolor', '#ffffff',
'name', 'Advert_long',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'Advert_long',
'salign', ''
); //end AC code
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be
placed here.'
+ 'This content requires the Adobe Flash Player.'
+ '<a href=http://www.macromedia.com/go/getflash/>Get
Flash</a>';
document.write(alternateContent); // insert non-flash content
// -->
</script>
<noscript>
// Provide alternate content for browsers that do not support
scripting
// or for those that have scripting disabled.
Alternate HTML content should be placed here. This content
requires the Adobe Flash Player.
<a href="
http://www.macromedia.com/go/getflash/">Get
Flash</a>
</noscript>
</body>
</html>You should use SWFObject to embed your Flash. Not only does
it make
embedding more straightforward, it makes passing query
parameters very easy.
Check out:
http://code.google.com/p/swfobject/
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
How to pass a variable from HTML to Flash 9
I have built my flash ad banner in Flash 9 and now want the
HTML code to pass the url over to the flash movie that it should
jump to when clicked.
The info in the help file seems out of date for the latest
HTML template as it uses mainly JavaScript to get round IE's
dreadful embeding issue. So my problem is, how do I pass a variable
from the HTML to the actionScript specified int he Help file
(running on a full screen button) as shown below?
myButton_btn.onRelease = function() {
if (clickTAG.substr(0, 5) == "http:") {
getURL(clickTAG);
via the html code now used by Flash 9 which is like this:
<!-- saved from url=(0013)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Advert_long</title>
<script language="javascript"> AC_FL_RunContent = 0;
</script>
<script language="javascript"> DetectFlashVer = 0;
</script>
<script src="AC_RunActiveContent.js"
language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 115;
// -->
</script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
Coping
with
Growing
Audio
Series
Theraputic stories
for children aged
4 to 9
-->
<script language="JavaScript" type="text/javascript">
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion,
requiredMinorVersion, requiredRevision);
if(hasRightVersion) { // if we've detected an acceptable
version
// embed the flash movie
AC_FL_RunContent(
'codebase', '
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
'width', '120',
'height', '600',
'src', 'Advert_long',
'quality', 'high',
'pluginspage', '
http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Advert_long',
'bgcolor', '#ffffff',
'name', 'Advert_long',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'Advert_long',
'salign', ''
); //end AC code
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be
placed here.'
+ 'This content requires the Adobe Flash Player.'
+ '<a href=http://www.macromedia.com/go/getflash/>Get
Flash</a>';
document.write(alternateContent); // insert non-flash
content
// -->
</script>
<noscript>
// Provide alternate content for browsers that do not
support scripting
// or for those that have scripting disabled.
Alternate HTML content should be placed here. This content
requires the Adobe Flash Player.
<a href="
http://www.macromedia.com/go/getflash/">Get
Flash</a>
</noscript>
</body>
</html>You should use SWFObject to embed your Flash. Not only does
it make
embedding more straightforward, it makes passing query
parameters very easy.
Check out:
http://code.google.com/p/swfobject/
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
Passing Session Variable from PHP to Applet
I'm trying to pass a session variable from a PHP script to a third party applet. The applet needs to accept the variable as a string into a parameter. I think the htnl has to be dynamically created to turn the session variable into a string for the parameter value. Any suggestions ?
This is really a PHP question. You might get better results on a PHP forum.
-
Passing a variable from Captivate 5 to Flash CS5/ActionScript 3
I don't get it. Why is it so difficult to pass a variable from Captivate 5 to AS3/Flash CS5. I must be making it harder than it really is. I cannot figure it out. Can anyone help?
I have a variable (gpDone = 1) defined in Captivate 5 (it's a guided practice) on the last frame which will indicate that the learner has completed the guided practice file.
Now I want to pass that variable back to Flash/AS3 so I can evaluate whether I should show the Continue button so they can continue. They have to complete the guided practice before they can continue. If it is equal to 1, the Continue button will display. If it is not equal to 1, the Continue button will not display, but a message will display telling them they have to complete the guided practice in order to continue in the course.
Do I need to edit the Flash html? Or just put code in the Flash timeline or the associated AS file?
Help would be greatly appreciated. Thanks in advance.
CAHHaving the same problem...getting variable values FROM captivate to my inserted .swf (not widgets).
I can set the value from the .swf to the captivate using Object(parent.parent.parent.parent).captivateVariable but not the other way around.
Very frustrating.
I hope someone answers your query.
Maybe you are looking for
-
Retriving multiple rows from the same table
Hi all, I have a table consisting of an id column as well as a start and end date. What I want to do is select the difference between start and end time for different id's. For example select (endtime where id = 1 - starttime where id = 2). Is this p
-
A query with row and colum numbers?
Hello, i have my java code divided into if conditions and in each if clause i need to select a certain field from a table. Is it somehow possible to select a table field which for example is in the third row and fifth column? So basically, how to sel
-
Hi Any one can tell me how to change the colors of web report. I searched forums but I dint get relevant answer. thnaks in advance Nikitha
-
Jabber file transfert from lan trouble
Hi, My mac is on a lan, I can receive incoming jabber file transferts but cannot send files. this is the xml query sent by ichat : <iq from='[email protected]/mac' to='[email protected]/gajim' type='set' id='iChat_78811B90'> <query xmlns='http://jabb
-
Updating Bootcamp 2.2 to 3.0
I am running Windows XP Home under Bootcamp 2.2 and Snow Leopard (updated from Leopard) on my end of 2007 2.2 GHz MBP. I am trying to update to Bootcamp 3.0. My legitimately Snow Leopard upgrade disk when inserted while running windows xp does not au