Writing Illustrator scripts with Java not javascript
Hi all, I am an experienced Java developer, I want to ask about can I write scripts in Adobe Illustrator with Java rather than javascript, I mean Did Adobe make Java API for Illustrator?
Thanks
Hello,
1) no, but c++, called plugin API ( Java Native Interface ? )
2) maybe ask here for plain Java binding : http://scriptographer.org/news/a-new-release/ (written in java) ?
chris
Similar Messages
-
How can i write a virus with java for the sole purpose of testing my networks virus protection software?
Yes, you can write viruses in Java, but I'm not going to tell you how... ;-P
No, seriously, it can be done, but these viruses are generally limited to infecting other Java programs. Think the applet sandbox is safe? Like hell is it! There are a lot of flaws in various VMs that you can exploit by the modification of existing class files. Then there is monkeying with JARs, and so on. It is certainly possible to do it, but since Java has limited potential to access the OS, there is not a great deal you could do about infecting it.
The most effective viruses nowadays take advantage of human weaknesses rather than OS holes, so you could still use that in Java. However this it not ostensibly what you want to test.
Copy the following (exactly) into a text file, and rename it to something .COM :
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
This is not a virus, and is completely harmless, but it is executeable and should trigger most anti-virus systems.
When executed, it should print the line:
EICAR-STANDARD-ANTIVIRUS-TEST-FILE!
This assumes you are running windoze. For other platforms, I cannot help you. -
sir i have seen that java 1.6 mustang version is supporrting java script
if it is so please any one can help me on how to make my JEditorPane
to support java script
not only to jEditorPane but to any other swings component
i tried in all ways please can any one give me this helpHello Farhan,
The OP stated that there is no condition on the process. In this case, I believe only 'SUBMIT' will cause the process to be fired.
"you can put anything in the string of the doSubmit."Well, you can do that, but it will have an effect only if you are using the REQUEST variable to condition a process. Otherwise, nothing will happen, and you want even receive an error message, because no error actually exist (as I believe happened with the OP case).
Regards,
Arie. -
Writing to socket with setinterval not working in windows
Hello Everyone,
I'm trying to stream a big file to my server, and was using 'setInterval' just fine to slowly upload it from OS X, but when I moved my AIR application to a Windows Vista computer, it no longer worked. I started doing some investigation and found out that 'socket.writeBytes' function was not working inside of 'setInterval'. I then moved the code inside of 'setInterval' to outside of it and everythink worked, but obviously it was no longer streaming. Thinking there was something wrong with 'setInterval', I tried it without the 'socket.writeBytes' function in it, and it started working fine.
Not sure what is happening, but it seems like a bug in the air.Socket code.
Here is my code:
var socket = new air.Socket();
socket.addEventListener(air.Event.CONNECT, function(e) {
var stream = setInterval(function() {
socket.writeBytes(filePart, 0, filePart.length);
if (isDone) {
clearInterval(stream);
}, 1000);
socket.connect("myServer", 80);
P.S. I also tried using 'air.Timer' and it was the same behavior as 'setInterval'.
Thanks for any help.Hi,
You should use the flush method:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/Socket.html#f lush%28%29
"Flushes any accumulated data in the socket's output buffer.
On some operating systems, flush() is called automatically between execution frames, but on other operating systems, such as Windows, the data is never sent unless you call flush() explicitly. To ensure your application behaves reliably across all operating systems, it is a good practice to call the flush() method after writing each message (or related group of data) to the socket."
I hope this helps!
-Erica -
Connecting a web script with JAVA
Hi
I am Trying to connect a php script from a java program. But I don't wan to implement a socket capability in the PHP script. My Main aim is to just measure how long it takes for the Entire PHP script to run. so my code might just look like this
var1 = System.currentTimeMillis();
connect the webserver script
var2 = System.currentTimeMillis();
response_time = var2 - var1;
Is there any way i can recognise that my script(PHP) has completed executing? so that I can goto the step var2 = ..
Basically I just want the code for "connect the webserver script". :)
cheers
ashayOpen the URL directly back to the server with;-
String host = getCodeBase().getHost().toString();
try {
URL url = new URL("http://"+host+"/cgi-bin/myStuff.php");
// then
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write("more stuff n nonsense");
wr.flush();
wr.close();You don't need to open a socket + u can use printWriter dataOutputStream or whatever works best for you -
Execute UNIX script from java not working
Hi
I am having difficulty running my java program to execute UNIX script on a Windows box. Here is my code.
public boolean executeScript() {
try {
String testScript= "WEB-INF/scripts/test.sh";
File file = new File(copyToQaScript);
System.out.println(file.getAbsolutePath());
Process proc = Runtime.getRuntime().exec(file.getAbsolutePath());
} catch (IOException ioe) {
ioe.printStackTrace();
logger.error(ioe);
} catch (RuntimeException re) {
re.printStackTrace();
logger.error(re);
} catch (Exception e) {
e.printStackTrace();
logger.error(e);
return true;
}When I execute this method, I am getting IOException as below.
java.io.IOException: CreateProcess: C:\tomcat-5.0.28\webapps\myProject\WEB-INF\scripts\test.sh error=193
Can anyone help me? Thanks.kminkeller wrote:
Yes I have Cygwin installed. I am quite aware of that thanks Sabre.Then you need something like
String[] command = {"bash","/home/sabre/bin/fred.sh"};
Process p = Runtime.getRuntime().exec(command);
if the executabe directory (/home/sabre/bin in my case) is not on the PATH or
String[] command = {"bash","fred.sh"};
Process p = Runtime.getRuntime().exec(command);
if it is. -
Communicate with java through javascript [accessControlException]
all right I have an applet with this method in it:
public String getText() throws UnsupportedFlavorException, IOException {
Clipboard clipboard = getToolkit().getSystemClipboard();
Transferable contents = clipboard.getContents(this);
return contents.getTransferData(DataFlavor.stringFlavor);
}in order to access the clipboard, the applet must be signed and it is.
Everything works fine from Java's side, but when I try accessing the method from javascript, i get this error:
SyntaxError: java.security.AccessControlException: access denied (java.awt.AWTPermission accessClipboard)why is that?
here is my javascript code:
var applet = document.getElementsByTagName('APPLET')[0];
try {
var textFromClipboard = applet.getText();
alert(textFromClipboard);
} catch (err) {
alert(err); // java.security error everytime...
}yes, I've looked into that but my method throws Exception and I can't capture them from outside that new inner class:
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() THROWS EXCEPTION {
Clipboard clipboard = getToolkit().getSystemClipboard();
Transferable contents = clipboard.getContents(this);
return contents.getTransferData(DataFlavor.stringFlavor);
});^ won't work -
UCCX 8.5 StreamCorruptedException: Scripts with Java
I was hoping anyone could help me with why this happens when a Script that contains custom Java classes causes this:
9050348: Dec 03 02:05:57.283 EET %MADM-SCRIPT_MGR-3-UNABLE_LOAD_SCRIPT:Unable to load script: Script=/CCInfoCollection.aef,Exception=com.cisco.io.StreamCorruptedException: invalid type code: 06; unable to load expression; ensure all custom classes are available; nested exception is:
java.io.StreamCorruptedException: invalid type code: 06
9050349: Dec 03 02:05:57.283 EET %MADM-SCRIPT_MGR-3-EXCEPTION:com.cisco.io.StreamCorruptedException: invalid type code: 06; unable to load expression; ensure all custom classes are available; nested exception is:
9050350: Dec 03 02:05:57.283 EET %MADM-SCRIPT_MGR-3-EXCEPTION: java.io.StreamCorruptedException: invalid type code: 06
Thanks in advanceAfter opening a Cisco TAC, they told me that the server needed a restart in order for all the Java classes to be loaded and visible to the server.
Just wanted to share this information should anyone else come across this issue in the future. -
Illustrator scripting with datasets & variables
I have a .ai file with 3 datasets containing 2 variables each. I am new to adobe scripting and am trying to write a script that will loop through the 3 datasets, swap out the variables, and save as 3 different .pdf files. I can loop and export, but don't know how to access the variables.
Here is a snipped from what I have:
for (var i=0; i< docRef.dataSets.length; i++){
var ds1 = docRef.dataSets.getByName('ABC'); // ABC is a client name, but numeric index is required
//var ds1 = docRef.dataSets.index(1); // this doesn't seem to work, but i need it to
docRef.activeDataset = ds1;
// I need to access the dataset variables here, where ClientName is a variable name within the dataset
client_name = ?????;
ds1.display();
app.redraw();
// ----- save changes
filepath = '/Users/me/Documents/clients/'+client_name+'.pdf';
saveInFile = new File( filepath );
pdfSaveOpts = getPDFOptions( );
docRef.saveAs( saveInFile, pdfSaveOpts );
Thanks for any helpmarkr34,
I have never done any dataset scripting, but my eyes tell me that at this line:
//var ds1 = docRef.dataSets.index(1); // this doesn't seem to work, but i need it to
you'd probably want to use square brackets [1] rather than parentheses to refer to array by index.
HTH -
Run .sh script with Java, then change window position
Is the following possible?:
From java, run a .sh script, which opens a total of 4 windows. (I know how to do this part).
Once the 4 windows (or more) are opened, I want to position them in specific locations on the screen. Is this possible, since the .sh script actually opens the windows?. Use the setLocation method in java.awt.Component??
any help is appreciated.
thxAs I recall, -geometry can have 4 numbers, I think it was {width}x{height}+{X location}+{Y location}, for example "-geometry 400x300+20+20". The + signs can be - signs if you want to count from the right or bottom margins.
Yeah, here's a quote from "man X":
most X programs accept a command line argument of
the form -geometry WIDTHxHEIGHT+XOFF+YOFF (where WIDTH, HEIGHT, XOFF,
and YOFF are numbers) for specifying a preferred size and location for
this application's main window.
Check out the man page for more details. -
ok so i have a midterm and need help this question that is gonna be on the midterm. i dont know how to do it and its worth 16 marks!!!! here it is
the UW Orchestra wants to produce a CD containing all the pieces of music
from its upcoming concert. In order to do that, it needs to calculate the total length of time for the
CD. In addition, the conductor wishes to know which piece of music has the longest duration.
Sample output for the program.
The Swan (3.88)
The Bee (0.98)
Claire de Lune (6.02)
Liebesfreund (3.38)
Ragtime (3.48)
The total time for the CD is 18.74 minutes.
The longest piece is Claire de Lune.
Do not include the HTML that is required to embed the program into a Web page (that is, show
only what you would write between <script> and </script> tags).
[4 marks] In the following space, define a function, Print, that takes two parameters, Title and
Length, and outputs a line of text such that Title appears in italics, followed by Length in
parentheses. The function also returns the value of Length.
For example, Print("My World",30) will output the line
My World (30)
and return the value 30.
Put your JavaScript program for the remainder of this question in the space provided on the next
two pages.
[9 marks]. For each piece of music, your program should input the title of the piece and the
duration (in minutes) for that piece, and it should output a line showing those values using the
Print function just defined. After all pieces have been listed, the program should output the
total length of time for the CD, adding in 0.25 minutes between each piece of music (which is
needed on the CD to separate the pieces).
[3 marks] The program should also output the name of the piece that has the longest playing
time.
Use reasonable variable names, indentation and good programming style. Documentation and
comments are not required, but you may add them to explain any assumptions you might want to
make. You need not check that the input is valid, and you may assume that no two pieces have the
same duration.
can anyone help me out! i would be indebt of ur kindness if u can help me out!This forum is for Java, not JavaScript. The two have nothing to do with each other.
And anyway, this is your studying, so you should try to do it, put forth your best effort, and ask specific questions (on the proper fourm). -
I have a problem with Java and an e-procurement system integrating
I use an e-procurement system at work and yesterday I could not get my parts list from the suppliers web site to display in our in-house eprocurment finance package.
There is not a problem with the finance package. There is not a problem with the suppliers web site. I have verified both of these by other colleagues being able to complete what I am trying to do.
The difference between my version of Firefox and my colleagues' is that I am on version 6.0.1 and they are on 6.0.
I have had problems with Java not displaying certain animations on the suppliers web site but, my colleague does not and I am suspicious that this is the problem. Can anyone verify this please and what can I do about it. My Java updates are up-to-date as of yesterday and are automatic.
Thanks.I was quite amazed I never got a reply to this, in the past people here have been helpful. In any case I was finally able to enter this website on the exceptions list in the Java panel, and I believe it is okay now.
-
Hi
i create a cookie called "SaveState" from javascript in my JSP dynpage.
I want to read this from java (NOT JAVASCRIPT).
Is this possible?
if not, is there some kind of portal memory I can use to pass values between java and javascript?
thanks
Anton KruseHi,
<b>Domain</b>
The "domain" parameter is used to set the domain the cookie is accessable to. A path can be set for your own domain only and the domain path must include at least two periods (.domain.com). It must match your server's domain name. Therefore cookies are not a security risk since only the server that sets them can use them.
Check this to know more about cookies:
http://www.comptechdoc.org/independent/web/cgi/javamanual/javacookie.html
If you still have questions, I will suggest to google on cookies.
Greetings,
Praveen Gudapati -
Need help with Java programming installation question
Sorry for my lack of knowledge about Java programming, but:....
A while back I thought I had updated my Java Runtime Environment programming. But I now apparently have two programs installed, perhaps through my not handling the installation properly. Those are:
J2SE Runtime Environment 5.0 update 5.0 (a 118MB file)
and:
Java 2 Runtime Environment, SE v 1.4.2_05 (a 108MB file)
Do I need both of these installed? If not, which should I uninstall?
Or, should I just leave it alone, and not worry about it?
Yeah, I don't have much in the way of technical knowledge...
Any help or advice would be appreciated. Thank you.
Bob VanHorstThanks for the feedback. I think I'll do just that. Once in a while I have a problem with Java not bringing up a webcam shot, but when that happens, it seems to be more website based than a general condition.
-
Can you write CGI scripts in Java or JavaScript and run them on a web server without modifying the server?
The equivalent of CGI scripts in Java are servlets. To
run servlets, you need a servlet container. I don't
know if your web server has a servlet container or a
way to connect a servlet container to it. Lookup
information on J2EE (Java 2 Enterprise Edition) on
this website.The man is correct. Or u can use JSP to the same end. You don't need J2EE tho i don't think...
Maybe you are looking for
-
How much does it cost to replace the lid of a MBP 13"?
Hi, I've got myself a Macbook Pro 13" (Mid-2009) that has got a fair few scratches in one corner and some noticeable dents on the lid. The top and bottom casing are all new after getting it repaired under AppleCare. I was wondering how much the lid w
-
Home Directory Script Question
Im not sure if this is the right area but i figured people in the automator section would know the most about this........anyways im trying to write a script and i need to know how to make the file path go to the non-specific users home directory for
-
Needed improvements to the panels
Panel close buttons should be smaller, like one pixel only. Also, can the non-UI conforming icons be even more confusing and obscure, please?
-
SEM CPM Drilldown does not work
In sem CPM, when selecting a value of filter in drilldown of a frame of SEM CPM does not update the graph. Some idea? Thanks. Jorge
-
MODBUS-RTU connection with aleatory VISA communication fails
Hi everyone, I have a big problem that I'm trying to repair since a pair of months. I have a MODBUS gateway connected to my pc via RS-485 in RTU mode. The physical implementation is based on Ethernet cable, so I have two connection converters in both