Cannot execute an AE script from Python 2.7
I'm trying to execute an AE script from Python and it doesn't appear that the script argument is passing correctly, or the the script won't run for some reason. I'm using Windows 7 with Python 2.7.
If I use cmd.exe or powershell and try
afterfx -r D:\pipeline\tests\tactic_ae\hello.jsx
I get my "hello world" alert in the AE UI.
However, if I try executing in Python:
subprocess.call(["afterfx","-r","D:\pipeline\tests\tactic_ae\hello.jsx"])
The AE UI takes focus but no alert appears. The really strange part is if I try to do something invalid like remove the -r flag:
subprocess.call(["afterfx","D:\pipeline\tests\tactic_ae\hello.jsx"])
I get an AE error:
After Error Can't import file "hello.jsx": unsupported filetype or extension
It does seem like Python is passing the arguments or the error above wouldn't be generated, but why won't the script run and display the alert? Thanks!
I've personally been unsuccessful in trying to attempt this, but I am also not too command line savvy. There may be a creative workaround out there somewhere though.
Similar Messages
-
Cannot Execute Any UNIX Scripts From DAC
Hello,
I have a BI system implementation on Oracle Solaris Servers. Both DAC as well as Informatica are on single server. My business requirement calls for a frequent Data load into BI and Cache purge. i checked the forum and found so many articles on how to automate Purging of Cache Post ETL. I am successful in creating a script to purge the cache and i already tested it by executing the script manually. But when i call this script from a DAC task it fails. In order to make sure that there is no problem with the Script i created a simple script which just says "Hello" and tried to invoke the script from DAC task but failed.
All Task Batches
External Program Batch
EXTERNAL PROGRAM TASKTest:/PurgeCache/CachePurge.sh:(Source : FULL Target : FULL)
2013-10-13 17:40:38.015 Acquiring Resources
2013-10-13 17:40:38.015 Acquired Resources
2013-10-13 17:40:38.015 EXTERNAL PROGRAM TASKTest:/PurgeCache/CachePurge.sh:(Source : FULL Target : FULL) has started.
ANOMALY INFO::: Error while executing : EXTERNAL PROGRAM TASKTest:/PurgeCache/CachePurge.sh:(Source : FULL Target : FULL)
MESSAGE:::com.siebel.analytics.etl.execution.exceptions.ExternalProcessException:
EXCEPTION CLASS::: java.lang.RuntimeException
com.siebel.analytics.etl.etltask.GenericTaskImpl.doExecuteWithRetries(GenericTaskImpl.java:536)
com.siebel.analytics.etl.etltask.GenericTaskImpl.execute(GenericTaskImpl.java:372)
com.siebel.analytics.etl.etltask.GenericTaskImpl.execute(GenericTaskImpl.java:253)
com.siebel.analytics.etl.etltask.GenericTaskImpl.run(GenericTaskImpl.java:655)
com.siebel.analytics.etl.taskmanager.XCallable.call(XCallable.java:63)
java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
java.util.concurrent.FutureTask.run(Unknown Source)
java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
java.util.concurrent.FutureTask.run(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
::: CAUSE :::
MESSAGE :::
EXCEPTION CLASS::: com.siebel.analytics.etl.execution.exceptions.ExternalProcessException
com.siebel.analytics.etl.etltask.ExternalProgramTask.doExecute(ExternalProgramTask.java:99)
com.siebel.analytics.etl.etltask.GenericTaskImpl.doExecuteWithRetries(GenericTaskImpl.java:477)
com.siebel.analytics.etl.etltask.GenericTaskImpl.execute(GenericTaskImpl.java:372)
com.siebel.analytics.etl.etltask.GenericTaskImpl.execute(GenericTaskImpl.java:253)
com.siebel.analytics.etl.etltask.GenericTaskImpl.run(GenericTaskImpl.java:655)
com.siebel.analytics.etl.taskmanager.XCallable.call(XCallable.java:63)
java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
java.util.concurrent.FutureTask.run(Unknown Source)
java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
java.util.concurrent.FutureTask.run(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
(Number of retries : 1)
/PurgeCache/CachePurge.sh
2013-10-13 17:40:38.031 EXTERNAL PROGRAM TASKTest:/PurgeCache/CachePurge.sh:(Source : FULL Target : FULL) has finished execution with Failed status.
(Failed)
Any help would be greatly appreciated.
thanks and regards,
SreeSee the thread below:
Re: FDM - Script -
Executing a shell script from a java program
Hi,
I'm facing a problem while executing a shell script from a jsp page.
I'm using exec() function.
It's working fine for single statement scripts.But if the script consists of any database processing and some other processing statements,it's not returning the correct exit status of the process.
Will u please help me in this.
If there is any other ways to execute a shell script from a jsp page other than Runtime.exec().If so let me know.
Thanks in advance.I think this shud workMaybe - but it is wrong! Why do you create aReader
and then read bytes which are turned into a String
without worrying about whether or not the bytes area
String and without worrying about the character
encoding if the bytes do represent characters and
without worrying about how many bytes wereactually
read.
Also, both you and the OP should read, digest and
follow the advice given in
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-
traps.htmlI dont care if it is wrong. This code works for me.
We are here to solve problems not to find which post
is wrong.It is wrong! You are posting bad advice that is very wrong! It may work for you but it is wrong in general! WRONG WRONG WRONG.
If you have a solution then post it I did post a solution! The reference I gave will explain to you and the OP exactly how it should be done.
rather then
posting rude comments.I was not rude! I was explaining just some of what was wrong! -
Executing a shell script from a jsp page
Hi,
I'm facing a problem while executing a shell script from a jsp page.
I'm using Runtime.exec() function.
It's working fine for single statement scripts.But if the script consists of any database processing and some other processing statements,it's not returning the correct exit status of the process.
Will u please help me in this.
If there is any other ways to execute a shell script from a jsp page other than Runtime.exec() like RMI etc,.If so let me know.
Thanks in advance.Hello,
It's hard to help you but what you can do is listening to the outputs of your script, you should read the output stream and error stream and send them to the default console.
Check this excellent article : http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4
Best regards,
Olivier. -
Error while executing unix shell script from java program
Hi All,
I am trying to execute unix shell script from a java program using Runtime.execute() method by passing script name and additional arguments.
Code snippet :
Java Class :
try{
String fileName ="test.ksh";
String argValue ="satish"; // value passed to the script
String exeParam = "/usr/bin/ksh "+fileName+" "+argValue;
Process proc = Runtime.getRuntime().exec(exeParam);
int exitValue = proc.waitFor();
sop("Exit Value is : "+exitValue);
catch(Exception e)
e.printStackTrace();
}Test.ksh
export -- application realated paths..
nohup abc.exe 1> test.log 2>&1;
$1
exit.By running the above java class , i am getting exit Value: 139 and log file test.log of 0 bytes.
when i am running the same command (/usr/bin/ksh test.ksh satish) manually, it's calling abc.exe file successfully
and able generate the logs properly.
Pls let us know where exactly i am stuck..
Thanks in advance,
Regards,
SatishHi Sabre,
As per the guidelines provided by the article, i had done below changes..
InputStream is = null;
InputStreamReader iStreamReader = null;
BufferedReader bReader = null;
String line = null;
try{
String fileName ="test.ksh";
String argValue ="satish"; // value passed to the script
String exeParam = "/usr/bin/ksh "+fileName+" "+argValue;
Process proc = Runtime.getRuntime().exec(exeParam);
is = proc.getErrorStream();
iStreamReader = new InputStreamReader(is);
bReader = new BufferedReader(iStreamReader);
System.out.println("<ERROR>");
while((line = bReader.readLine()) != null)
System.out.println("Error is : "+line);
System.out.println("</ERROR>");
int exitValue = proc.waitFor();
sop("Exit Value is : "+exitValue);
catch(Exception e)
e.printStackTrace();
Now , it's showing something like..
<ERROR>
</ERROR> -
Can we execute a Powershell script from the Javascript?
Hi,
I have a certain requirement to add a Custom ribbon button in document library and there was a powershell script to be run for the selected item in the library.
I have struck with executing a Powershell script from the javascript function.
Can anyone please suggest me if this was achievable
Thanks, Swaroop VuppalaHi Swaroop,
To execute server side code in a custom ribbon button script, using application page is a common way to do this, besides, you can also use a page dialog, which is similar with application page but display as model dialog, another way is javascript
_dopostback and delegate control, the following article contains detailed information about this, please refer to it for more information:
Invoke server side code on SharePoint ribbon click:
http://sharepointnadeem.blogspot.in/2012/07/invoke-server-side-code-on-sharepoint.html
Thanks,
Qiao Wei
TechNet Community Support -
How to execute unix shell script from Java ...
Hi,
Anyone know how to execute unix shell script from Java?
Suppose I have several shell scripts written in perl or tcl or bash.
I just want to catch the output of that script.
Is there any ready to use module/object for this?
Please let me know, this is quite urgent for my study assigment.
Thanks in advance,
Regards,
meLook up Runtime.exec()
-
Example: Executing a shell script from java
Hi. There are many other posts in the forums related to executing a unix script from java, but I wanted to post another example that I thought might be helpful...
The key thing to executing the script is to include the -c switch for the sh command. This tells the sh command that you are passing a string to be interpreted as input. Without this switch, the script does not execute as you'd expect it to. Also, use a string array to pass each part of the sh command.
Here is a working sample class, along with a test script to execute it:
public class TestShellScript {
public static void main(String[] args)
String[] chmod = {"chmod","777","testscript1"};
String[] runscript = {"sh","-c","./testscript1 > jdata.out"};
Runtime rtime = Runtime.getRuntime();
try
rtime.exec(chmod); // Set the authorities for testing
rtime.exec(runscript); // Run the script with redirection
catch (IOException e)
e.printStackTrace();
rtime = null;
Here is a test script to wrap the java call:
#!/bin/sh
cd /<your script dir>
export -s CLASSPATH=/<your jar dir>/TestShellScript.jar
export -s PATH=/<your script dir>:/usr/bin
java TestShellScript
- Hope this helps.I don't know exactly but the code written below is working fine try the same with your code .Even with your code instead running the code with
" ./<filename> ",if you execute it with "sh <filename>" command without changing the mode of the file it is executing properly.
import java.io.*;
import java.util.*;
public class ScriptBuilder
public ScriptBuilder()
public void writeScript() throws java.io.IOException
FileWriter writer = new FileWriter(new File("test_script"));
writer.write("#! /bin/sh\n");
writer.write("ll>/home/faiyaz/javaprac/checkll");
writer.flush();
writer.close();
Runtime rt= Runtime.getRuntime();
rt.exec("chmod 777 test_script");
rt.exec("./test_script");
} public static void main (String[] args)throws java.io.IOException
ScriptBuilder sb = new ScriptBuilder();
sb.writeScript();
} -
Execute Essbase Calc Scripts from FDM
Hi,
Can any of you let me know how to execute Essbase Calc Scripts from FDM, these Calc Scripts are on Essbase Server. Any help would be greatly appreciated.
ThanksSee the thread below:
Re: FDM - Script -
Executing a perl script from within java application
Hi,
Does anyone knows a way to execute a perl script from within java.
---kirkRuntime.exec("perl myscript.pl");
Of course whether that "works" depends on what the script does and where the java program runs. -
Can we execute an idoc script from a custom service?
Is it possible to execute an idoc script while executing a custom service?
-PratapThere are several ways to execute iDocScript from Java, but in this quick example we will use a PageMerger object. There are several ways to get ahold of a PageMerger object. If you are executing in a context where a service object is readily available you may be able to get a PageMerger object reference with code like this:
PageMerger pm = m_service.m_pageMerger;
If that doesn't work for you I would try something like:
PageMerger pm = new PageMerger(databinder, executioncontext);
Now that you have your merger object you can execute all kinds of iDocScript code, an example of which might be:
pm.evaluateScript("<$lc(\"wwMyString\")$>"); -
Executing SAP GUI Script From a Web Page
I have an issue when trying to execute some javascript (sap gui script) from a webpage.
When the javascript is executed I get the message:
automation server unable to create object.
However, this exact same javascript when placed in a text file and double-clicked executes just fine through the windows scripting host.
Does anyone have an example of gui script code executing from a webpage? Or any ideas on why it isn't working from the webpage? Both scenarios should be executing the code on the local machine through WSH.
Below is the javascript as well as the webpage executing the javascript:
SAPGUI SCRIPT
if (typeof(application) == "undefined")
sapgui = GetObject("SAPGUI");
application = sapgui.GetScriptingEngine;
if (typeof(connection) == "undefined")
connection = application.children(0);
if (typeof(session) == "undefined")
session = connection.children(0);
if (typeof(WScript) != "undefined")
WScript.connectObject(session, "on");
WScript.connectObject(application, "on");
session.findById("wnd[0]").maximize();
session.findById("wnd[0]/tbar[0]/okcd").text = "/nzsd1067";
session.findById("wnd[0]").sendVKey(0);
session.findById("wnd[0]/usr/ctxtVBAK-KUNNR").text = "6343";
session.findById("wnd[0]").sendVKey(0);
WEBPAGE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<! INPUT PARAMETER SETTINGS:
To Push data to Siebel or SAP the appropriate
field below must be set = TRUE.
Pop_SAP
Pop_Siebel
SIEBEL INPUT PARAMETER: When
Pushing data to a Siebel screen the Query_Type should be set based on the type
of lookup that is requested.
Query_Type = 'SAP' -presents a screen based on a customer SAP Id.
Query_Type = 'SR' -presents a screen based on a Service Request.
Query_Type = '' or null -presents a search screen to locate the proper contact in Siebel
APP_SAP_ID -SAP customer Id
APP_SR_NUM -Siebel Service Request Number
>
<SCRIPT LANGUAGE="VBScript">
Sub LoadContact()
'Siebel Application Object
Dim siebApp 'As SIEBELHTMLLib.ISiebelHTMLApplication
Dim siebSvcs 'As SIEBELHTMLLib.ISiebelService
Dim siebOutputPropSet 'As SIEBELHTMLLib.ISiebelPropertySet
Dim siebInputPropSet 'As SIEBELHTMLLib.ISiebelPropertySet
Dim bool 'As Boolean
Dim errCode 'As Integer
Dim errText 'As String
Dim QueryType 'As String
Dim PopSAP 'As String
PopSiebel = "TRUE"
If PopSiebel = "TRUE" Then
QueryType = "SAP"
If QueryType = "null" Then
QueryType = ""
End If
'Create The SiebelHTML Object
set siebApp = CreateObject("SiebelHTML.SiebelHTMLApplication.1")
If Not siebApp Is Nothing Then
'Create A New Property Set
set siebInputPropSet = siebApp.NewPropertySet
set siebOutputPropSet = siebApp.NewPropertySet
If Not siebInputPropSet Is Nothing Then
siebInputPropSet.SetProperty "ANI", "9738986011"
siebInputPropSet.SetProperty "SAP_ID", "0000516616"
siebInputPropSet.SetProperty "SR_NUM", "null"
siebInputPropSet.SetProperty "Interaction_ID", "168608840053"
siebInputPropSet.SetProperty "Query_Type", QueryType
Else
errCode = siebApp.GetLastErrCode
errText = siebApp.GetLastErrText
MsgBox "Could not Create Siebel Property Set: " & errCode & "::" & errText
End If
'Get A Siebel Service
set siebSvcs = siebApp.GetService ("TAWBS")
If Not siebSvcs Is Nothing Then
siebSvcs.InvokeMethod "TAWPresentAccount", siebInputPropSet, siebOutputPropSet
Else
errCode = siebApp.GetLastErrCode
errText = siebApp.GetLastErrText
MsgBox "Could not Get Siebel Service: " & errCode & "::" & errText
End If
set siebApp = Nothing
End If
set siebInputPropSet = Nothing
set siebOutputPropSet = Nothing
set siebSvcs = Nothing
End If
End Sub
</SCRIPT>
<SCRIPT LANGUAGE="javascript">
function loadSAP()
if (typeof(application) == "undefined")
sapgui = GetObject("SAPGUI");
application = sapgui.GetScriptingEngine;
if (typeof(connection) == "undefined")
connection = application.children(0);
if (typeof(session) == "undefined")
session = connection.children(0);
if (typeof(WScript) != "undefined")
WScript.connectObject(session, "on");
WScript.connectObject(application, "on");
session.findById("wnd[0]").maximize();
session.findById("wnd[0]/tbar[0]/okcd").text = "/nzsd1067";
session.findById("wnd[0]").sendVKey(0);
session.findById("wnd[0]/usr/ctxtVBAK-KUNNR").text = "0000516616";
session.findById("wnd[0]").sendVKey(0);
} // end
</SCRIPT>
</head>
<body onload="loadSAP()">
<H3><FONT face="Arial" size="5">Raytheon Integration Screen</FONT></H3>
<HR style="WIDTH: 882px; HEIGHT: 8px" color="#3366cc" SIZE="8">
<form id="ValidForm" onsubmit="LoadContact(); return false;" language="jscript">
<FONT face="Arial">Load Siebel Screen</FONT> <! <input name="Text1" TYPE="TEXT"
SIZE="10" ID="Text1"> <input name="Submit" TYPE="submit" VALUE="Submit" ID="Submit1">
</form>
<form id="Form1" onsubmit="loadSAP(); return false;" language="javascript">
<FONT face="Arial">Load SAP Screen</FONT> <! <input
name="Text2" TYPE="TEXT" SIZE="10" ID="Text2"> <input name="Submit" TYPE="submit" VALUE="Submit" ID="Submit2">
</form>
</body>
</html>Hi Bernd,
the following code works in VBS. If you run saplogon.exe you'll get a message box saying '/app'.
Set Wrp = CreateObject ("SapROTWr.SapROTWrapper")
Set SapGui = Wrp.GetROTEntry ("SAPGUI")
Set application = sapgui.GetScriptingEngine
MsgBox application.id
I haven't tried it on a web page, but I don't see why it shouldn't work there. Ok, maybe the MsgBox is command is not available.
Best regards,
Christian -
Execute a shell script from inside PL procedure
Oracle 9205 on Red Hat Enterprise Linux 3.
Is there any way to execute an O.S. shell script from inside a PL/SQL procedure?
This is, that PL_SQL procedure evaluate a situation and if the condition is true, it calls and execute an O.S. shell script.PL/SQL procedures do not support any native calls to the OS; however, you can code calls to external procedures or JAVA procedures to perform tasks on the OS.
Prior to these two methods any of the following packages dbms_alert, dbms_pipe, or utl_file could be combined with a daemon type program to issue OS commands, run shell scripts, etc....
There is a writeup on metalink with examples.
HTH -- Mark D Powell -- -
Executing a shell script from a form (client / server)
From a form in a client server environment, I would like to execute a shell script on the server.
Environment:
Server: SunOS 5.6
DB : 8.0.5
Forms : Developer 6 w/patch 6A
Forms - 6.0.5.34.0Jim,
Yes. Use the host command from forms and call the command rexec.
Raymond
null -
Execute SQL*PLUS script from VB6?
I'm using VB6 to connect to oracle 10 with oracle client 8i, I can establish the connection without any problems.
If I run a SQL statement from VB it works prefect, but when I try to run a SQL Plus script from VB I get error ORA-00900, "invalid SQL statement". Everything works fine in oracle SQLPLUS.
Is there anything I have missed about running SQL*PLUS script from VB6? Is'nt it the same as a SQL statement?Thanks for you answer Justin,
This is a short variant of SQL*Plus I wanna execute from VB and transfer the result into a listview in VB.
If this is possible from VB, can you show me how I should do?
COLUMN customer_1 NEW_VALUE customer_1 NOPRINT
COLUMN customer_2 NEW_VALUE customer_2 NOPRINT
SELECT customer customer_1
FROM (
SELECT customer,
ROW_NUMBER() OVER(PARTITION BY customer ORDER BY CustomerTotalSales DESC) CustomerTotalSalesRank
FROM (
SELECT customer,
SUM(SalesQty) OVER(PARTITION BY customer) CustomerTotalSales
FROM CustTable
WHERE year_month BETWEEN 200709 AND 200801
WHERE CustomerTotalSalesRank = 1
AND ROWNUM = 1
SELECT customer customer_2
FROM (
SELECT customer,
ROW_NUMBER() OVER(PARTITION BY customer ORDER BY CustomerTotalSales DESC) CustomerTotalSalesRank
FROM (
SELECT customer,
SUM(SalesQty) OVER(PARTITION BY customer) CustomerTotalSales
FROM CustTable
WHERE year_month BETWEEN 200709 AND 200801
WHERE CustomerTotalSalesRank = 2
AND ROWNUM = 1
SET VERIFY OFF
SELECT year_month,
SUM(
CASE CustomerTotalSalesRank
WHEN 1
THEN
SalesQty
ELSE
NULL;
END
) "&customer_1",
SUM(
CASE CustomerTotalSalesRank
WHEN 2
THEN
SalesQty
ELSE
NULL;
END
) "&customer_2"
FROM (
SELECT year_month,
SalesQty,
ROW_NUMBER() OVER(PARTITION BY customer ORDER BY CustomerTotalSales DESC) CustomerTotalSalesRank
FROM (
SELECT customer,
year_month,
SalesQty,
SUM(SalesQty) OVER(PARTITION BY customer) CustomerTotalSales
FROM CustTable
WHERE year_month BETWEEN 200709 AND 200801
WHERE CustomerTotalSalesRank <= 10
GROUP BY year_month
ORDER BY year_month
/
Maybe you are looking for
-
Problem with Adobe Extension Manager
Hi, I run Photoshop CS4, Bridge CS4 and Dreamweaver CS5 on a Windows 7 pc. I've been trying to download the BridgeExportToJpegCS4 plugin but keep getting the error message "This extension can not be installed, it requires Bridge version 3 or greater
-
Hi I have a HUGE problem: Gnome blocks my keyboard. I can login with GDM (keyboard works) but as soon as gnome starts up the keyboard doesn't work anymore. I can't even change to another tty with CTRL+ALT+F1 F2 or any other tty. I managed to start a
-
Spry tabs nested in accordion on IE.
I am trying to put a tabbed panel in an accordion panel. In IE6 and I believe 7 as well, the tabs do not hide. Everything looks fine in FF and Safari. Any ideas on fixing this?
-
Displaying which albums a particular photo is in
I have about 8000 photos in my library. Some are duplicates. I want to eliminate the duplicates but I'm not sure which of the duplicates are already in one of my albums. I don't want to delete the one that is already in an album and I don't want to g
-
Hey all. Just a quick one: if I click +Advanced > Consolidate library+ will this consolidate all the tunes from my partners profile on Windows also? I just don't want to press it and the entire back catalogue of my partner appear with mine. An added