Automating program

Hi! I need help.
I have to create a java program that initialise a crystal object, run it and save the report to some where.
I should then schedule the java program as a service in windows admin setup to run every day.

I have to create a java program that initialise a
crystal object, There are essential 3 method of initialising an object.
1) Static initialisation.
2) Initiasation via the objects constructor.
3) Using a setter function.
e.g.
public class Crystal {
  private static String string = "Value" ;  // method 1
  private int integer = 0 ;
  public Crystal() {
  // method 2
  public Crystal(int value) {
    this.integer = value ;
  // method 3
  public void setInteger(int value) {
    this.integer = value ;
  public static void main(String[] args) {
    Crystal crystal = new Crystal() ;
    crystal.setInteger( 99 ) ;
    Crystal crystal_2 = new Crystal( 99 ) ;
}This following tutorial will answer your remaining questions.
http://java.sun.com/learning/new2java/index.html

Similar Messages

  • How to create security character validation to avoid automated programs

    Hi All,
    I am developing a web page for creating user accounts. I would like to do the security character validation to avoid the misuse from automated programs.
    This is what you may have seen on all popular web pages where you are asked to enter a scrambled set of characters into a text field before submitting your request.
    Please provide any samples or direct me where I can get some help on this.
    Your help is greatly appreciated.
    TIA,
    CK

    Why look for samples when u can can use ur own logic and thinking ?
    My approach ...
    1) Create a lot of scambled images having alphabets like 'rhoit' , 'rohit' ..
    File naming convention should be same as the text. Ex: rhoit.jpg, rohit.jpg ...
    2) Add the images names into a table and then populate a HashMap / ArrayList containing the image names
    3) Randomly pick some artibitrary element from the Arraylist and display the corresponding image in the create user accounts page.
    3) Compare the image name with the inputed text value for a match. The expected value should be set in request parameter.
    4) Handle the success/failure condition.
    I hope that should work fine.
    Regards
    -Rohit

  • Trying to write an Automator program to find files with same time created and change file names to matching source folder names

    I am failrly green when it comes to automator.
    I am trying to write an Automator program:
    Not sure where to post this
    trying to write an Automator program to find files and alter their names
    I have a source folder with correct named master files in it.
    eg. A0001_1234.mpeg
    time created 14:02:03
    date 07/07/2012
    Another folder where there will be copies of the master files in a different format with different names but created at the same time as a file in the source directory.
    they are created with a seperate device but they are
    A0000001.mp4
    time created 14:02:03
    date 07/07/2012
    I need it to then take the name from the source fies and apply the correct name to the matching file based on the time it was created.
    I can't seem to find actions in automator that reference time crated.
    Is this something I will be able to Do in automator?
    Any help would be great
    Thanks
    R

    Hi,
    It's impossible to do this without any script in Automator.
    Use this AppleScript script :
    set source to choose folder with prompt "Select the source folder"
    set anotherfolder to choose folder with prompt "Choose the another folder"
    tell application "Finder"
        repeat with tfile in (get files of source)
            set cDate to creation date of tfile
            set findFiles to (files of anotherfolder whose creation date is cDate)
            if findFiles is not {} then
                set tName to name of tfile
                set name of item 1 of findFiles to tName
            end if
        end repeat
    end tell

  • Any way to globally change volume automation programming?

    Anyone know if there's a way to globally shift the automation programming for the volume, so that any program changes settings can be increase or decreased together.
    I realize that some effect can be inserted to the track to boost or cut, but is there a way to accomplish the goal by simply shifting the automation programming?

    If you hold command and click-drag on the vertical scale segmented meter looking thing that is on the very right side of the track header when automation is visible it will do what (I think) you are asking.

  • Java Automation Program Debugging help

    Dear fellow members,
    a ex-coworker has written a java applet for my system measuring automation. Unfortunatly it stopped working and i have no idea why. I will write down what the program is supposed to do and what it does. Thank you in advance for all your help, it is really apreciated. And excuse my english, this is not my native language.
    HIOKI = Power consumption measuring device
    The program hiok.jar looks into a specified directory (which is defined in the hioki.ini) for 4 files.
    s0idle.txt
    s0active.txt
    s3.txt
    s5.txt
    First it looks for the s0idle.txt and starts the HIOKI device via the RS232c interface. It sets the voltage, current range etc.. and a integer for 5 minutes. After the measuring is completed it should print out the "resulats" and wait for the s0active.txt which then restarts the measuring process with different values.
    The program used to work just fine, but for some odd reason it does not anymore. The first file "s0idle.txt" is found the measuring is initialized but it never prints out the results or continues to the s0active.txt file. After all 4 measurements are done it should create an xls file.
    Below is the source code and maybe you can help me. Unfortunatly i have ABSOLUTE ZERO knowledge about java. I am not a programmer but have to fix this for my department. looks odd ;-)
    Thanks
    Florian
    package hioki;
    import java.io.*;
    import javax.swing.*;
    * @author Administrator
    public class HIOKI_main {
         * @param args
         private static String mess="";
         private static HIOKI_excel excelDatei=null;
         private static String OutputFolder="C:\\HIOKI-Output";
         private static String InstructionFolder="X:\\Automat";
         private static int s0idleDelay=0;
         private static String s0idleMaxVolt="300";
         private static String s0idleMaxCurr="2";
         private static int s0activeDelay=80;
         private static String s0activeMaxVolt="300";
         private static String s0activeMaxCurr="2";
         private static int s3Delay=80;
         private static String s3MaxVolt="300";
         private static String s3MaxCurr="200.0E-3";
         private static int s5Delay=10;
         private static String s5MaxVolt="300";
         private static String s5MaxCurr="200.0E-3";
         private static String port="COM1";
         public static void main(String[] args) {
              boolean run=true;
              while(run)
                   //ini-File lesen und auswerten
                   File eingabedatei;
                   FileReader fr;
                   BufferedReader br;
                   eingabedatei=new File("hioki.ini");
                   //TODO
                   System.out.println("wait + read: "+eingabedatei.getAbsolutePath());
                   //Datei lesen und in Array abspeichern
                   try{
                        fr=new FileReader(eingabedatei);
                        br=new BufferedReader(fr);
                        String input="";
                        while((input=br.readLine())!=null)
                             if(input.startsWith("OutputFolder:"))
                             {     OutputFolder=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(OutputFolder);
                             else if(input.startsWith("InstructionFolder:"))
                             {     InstructionFolder=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(InstructionFolder);
                             else if(input.startsWith("Port:"))
                             {     port=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(port);
                             else if(input.startsWith("s0idle-Delay:"))
                             {     s0idleDelay=Integer.valueOf(input.substring(input.indexOf(" ")+1)).intValue();
                                  //System.out.println(s0idleDelay);
                             else if(input.startsWith("s0idle-maxVolt:"))
                             {     s0idleMaxVolt=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s0idleMaxVolt);
                             else if(input.startsWith("s0idle-maxCurr:"))
                             {     s0idleMaxCurr=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s0idleMaxCurr);
                             else if(input.startsWith("s0active-Delay:"))
                             {     s0activeDelay=Integer.valueOf(input.substring(input.indexOf(" ")+1)).intValue();
                                  //System.out.println(s0activeDelay);
                             else if(input.startsWith("s0active-maxVolt:"))
                             {     s0activeMaxVolt=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s0activeMaxVolt);
                             else if(input.startsWith("s0active-maxCurr:"))
                             {     s0activeMaxCurr=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s0activeMaxCurr);
                             else if(input.startsWith("s3-Delay:"))
                             {     s3Delay=Integer.valueOf(input.substring(input.indexOf(" ")+1)).intValue();
                                  //System.out.println(s3Delay);
                             else if(input.startsWith("s3-maxVolt:"))
                             {     s3MaxVolt=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s3MaxVolt);
                             else if(input.startsWith("s3-maxCurr:"))
                             {     s3MaxCurr=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s3MaxCurr);
                             else if(input.startsWith("s5-Delay:"))
                             {     s5Delay=Integer.valueOf(input.substring(input.indexOf(" ")+1)).intValue();
                                  //System.out.println(s5Delay);
                             else if(input.startsWith("s5-maxVolt:"))
                             {     s5MaxVolt=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s5MaxVolt);
                             else if(input.startsWith("s5-maxCurr:"))
                             {     s5MaxCurr=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s5MaxCurr);
                   catch(FileNotFoundException e){}
                   catch(IOException e){}
                   try
                   {     Thread.sleep(2000);}
                   catch(InterruptedException e)
                   File instructionFile=new File(InstructionFolder);
                   if(instructionFile.exists()==true)
                        String[] list=instructionFile.list();
                        for(int i=0;i<list.length;i++)
                             //Wenn Datei mit Namen exit vorhanden ist, dann Programm beenden
                             if(list.endsWith("exit"))
                                  new File(InstructionFolder+"+\\exit").delete();
                                  int ok=JOptionPane.showConfirmDialog(null,"Beenden","found",JOptionPane.OK_CANCEL_OPTION,JOptionPane.INFORMATION_MESSAGE);
                                  if(ok==JOptionPane.OK_OPTION)
                                  {     return;}
                             if(list[i].endsWith("s0idle.txt")==true)
                                  //Excel-Datei initialisieren
                                  try{     excelDatei=new HIOKI_excel();}
                                  catch(IOException e){};
                                  //s0idle Datei �ffnen
                                  instructionFile=new File(InstructionFolder+"\\s0idle.txt");
                                  if(instructionFile.exists()!=false)
                                       System.out.println("s0idle gefunden");
                                       //Hioki mit s0idle starten
                                       try
                                       {     Thread.sleep(s0idleDelay*1000);}
                                       catch(InterruptedException e)
                                       System.out.println("s0idle starten");
                                       mess=s0idle();
                                       System.out.println(mess);
                                       System.out.println("s0idle loeschen");
                                       instructionFile.delete();
                                       //s0active Datei �ffnen
                                       int s0idleExists=0;
                                       for(instructionFile=new File(InstructionFolder+"\\s0active.txt");instructionFile.exists()!=true;instructionFile=new File(InstructionFolder+"\\s0active.txt"))
                                            instructionFile=new File(InstructionFolder+"\\s0idle.txt");
                                            if(instructionFile.exists()==true)
                                            {     s0idleExists=1;
                                                 break;
                                            //2 Sekunden schlafen bis weiter gesucht wird
                                            try{     Thread.sleep(2000);}
                                            catch(InterruptedException e){}
                                       //Wenn s0idle gefunden wird, dann von neuem beginnen
                                       if(s0idleExists==1)
                                       {     break;}
                                       System.out.println("s0active gefunden");
                                       //Hioki mit s0active starten
                                       try
                                       {     Thread.sleep(s0activeDelay*1000);}
                                       catch(InterruptedException e)
                                       System.out.println("s0active starten");
                                       mess=s0active();
                                       System.out.println(mess);
                                       System.out.println("s0active loeschen");
                                       instructionFile.delete();
                                       //s3
                                       s0idleExists=0;
                                       for(instructionFile=new File(InstructionFolder+"\\s3.txt");instructionFile.exists()!=true;instructionFile=new File(InstructionFolder+"\\s3.txt"))
                                            instructionFile=new File(InstructionFolder+"\\s0idle.txt");
                                            if(instructionFile.exists()==true)
                                            {     s0idleExists=1;
                                                 break;
                                            try
                                            {     Thread.sleep(2000);}
                                            catch(InterruptedException e)
                                       //Wenn s0idle gefunden wird, dann von neuem beginnen
                                       if(s0idleExists==1)
                                       {     break;}
                                       System.out.println("s3 gefunden");
                                       //Hioki mit s3 starten
                                       try
                                       {     Thread.sleep(s3Delay*1000);}
                                       catch(InterruptedException e)
                                       System.out.println("s3 starten");
                                       mess=s3();
                                       System.out.println(mess);
                                       System.out.println("s3 loeschen");
                                       instructionFile.delete();
                                       //s5
                                       s0idleExists=0;
                                       for(instructionFile=new File(InstructionFolder+"\\s5.txt");instructionFile.exists()!=true;instructionFile=new File(InstructionFolder+"\\s5.txt"))
                                            instructionFile=new File(InstructionFolder+"\\s0idle.txt");
                                            if(instructionFile.exists()==true)
                                            {     s0idleExists=1;
                                                 break;
                                            try
                                            {     Thread.sleep(2000);}
                                            catch(InterruptedException e)
                                       //Wenn s0idle gefunden wird, dann von neuem beginnen
                                       if(s0idleExists==1)
                                       {     break;}
                                       System.out.println("s5 gefunden");
                                       //Hioki mit s5 starten
                                       try
                                       {     Thread.sleep(s5Delay*1000);}
                                       catch(InterruptedException e)
                                       System.out.println("s5 starten");
                                       mess=s5();
                                       System.out.println(mess);
                                       System.out.println("s5 loeschen");
                                       instructionFile.delete();
                                       //Auftragsnummer abfragen
                                       String antwort=null;
                                       for(;antwort==null||antwort=="";)
                                       {     antwort = JOptionPane.showInputDialog(null, "Messung abgeschlossen!\nAuftragsnummer: ", "Messung abgeschlossen!", JOptionPane.QUESTION_MESSAGE);}
                                       //Excel Datei schreiben
                                       System.out.println("Excel Datei schreiben");
                                       try{     excelDatei.close(OutputFolder, antwort);}
                                       catch(IOException e){}
                                  break;
         private static String s0idle()
              HIOKI_RS232 hioki=new HIOKI_RS232(port);
              System.out.println("start");
              hioki.sendString("*RST");
              hioki.sendString("RESP FAST");
              hioki.sendString("VOLT:AUTO OFF");
              hioki.sendString("VOLT:RANG "+s0idleMaxVolt);
              hioki.sendString("CURR:AUTO OFF");
              hioki.sendString("CURR:RANG "+s0idleMaxCurr);
              hioki.sendString("DISP V,A,W,WH");
              hioki.sendString("INTEG:TIME 0,5,0");
              hioki.sendString("INTEG:STAT START");
              //5 Minuten warten
              try
              {     Thread.sleep(5*60000);}          //=5 min
              catch(InterruptedException e)
              String erg="";
              for(;erg.indexOf("STATE STOP")==-1;)
                   erg=hioki.sendStringAndGetAnswer("INTEG:STAT?");
              //Werte in Excel Datei schreiben
              hioki.sendString("HEAD OFF");
              String v=hioki.sendStringAndGetAnswer("MEAS? V");
              String a=hioki.sendStringAndGetAnswer("MEAS? A");
              String freq=hioki.sendStringAndGetAnswer("MEAS? FREQ");
              String w=hioki.sendStringAndGetAnswer("MEAS? W");
              String pwh=hioki.sendStringAndGetAnswer("MEAS? PWH");
              hioki.sendString("HEAD ON");
              v.substring(0, v.length()-2);
              a.substring(0, a.length()-2);
              freq.substring(0, freq.length()-2);
              w.substring(0, w.length()-2);
              pwh.substring(0, pwh.length()-2);
              excelDatei.setS0idle(v, a, freq, w, pwh);
              System.out.println("s0idle: U="+v+"V ; I="+a+"A ; Freq="+freq+"Hz ; P="+w+"W ; W="+pwh+"WH");
              erg=hioki.sendStringAndGetAnswer("MEAS?");
              hioki.disconnect();
              return erg;
         private static String s0active()
              HIOKI_RS232 hioki=new HIOKI_RS232(port);
              hioki.sendString("*RST");
              hioki.sendString("RESP FAST");
              hioki.sendString("VOLT:AUTO OFF");
              hioki.sendString("VOLT:RANG "+s0activeMaxVolt);
              hioki.sendString("CURR:AUTO OFF");
              hioki.sendString("CURR:RANG "+s0activeMaxCurr);
              hioki.sendString("DISP V,A,W,WH");
              hioki.sendString("INTEG:TIME 0,10,0");
              hioki.sendString("INTEG:STAT START");
              //10 Minuten warten
              try
              {     Thread.sleep(10*60000);}          //=10 min
              catch(InterruptedException e)
              String erg="";
              for(;erg.indexOf("STATE STOP")==-1;)
                   erg=hioki.sendStringAndGetAnswer("INTEG:STAT?");
              //Werte in Excel Datei schreiben
              hioki.sendString("HEAD OFF");
              String v=hioki.sendStringAndGetAnswer("MEAS? V");
              String a=hioki.sendStringAndGetAnswer("MEAS? A");
              String freq=hioki.sendStringAndGetAnswer("MEAS? FREQ");
              String w=hioki.sendStringAndGetAnswer("MEAS? W");
              String pwh=hioki.sendStringAndGetAnswer("MEAS? PWH");
              hioki.sendString("HEAD ON");
              v.substring(0, v.length()-2);
              a.substring(0, a.length()-2);
              freq.substring(0, freq.length()-2);
              w.substring(0, w.length()-2);
              pwh.substring(0, pwh.length()-2);
              excelDatei.setS0active(v, a, freq, w, pwh);
              System.out.println("s0active: U="+v+"V ; I="+a+"A ; Freq="+freq+"Hz ; P="+w+"W ; W="+pwh+"WH");
              erg=hioki.sendStringAndGetAnswer("MEAS?");
              hioki.disconnect();
              return erg;
         private static String s3()
              HIOKI_RS232 hioki=new HIOKI_RS232("COM1");
              hioki.sendString("*RST");
              hioki.sendString("RESP FAST");
              hioki.sendString("VOLT:AUTO OFF");
              hioki.sendString("VOLT:RANG "+s3MaxVolt);
              hioki.sendString("CURR:AUTO OFF");
              hioki.sendString("CURR:RANG "+s3MaxCurr);
              hioki.sendString("DISP V,A,W,WH");
              hioki.sendString("INTEG:TIME 0,5,0");
              hioki.sendString("INTEG:STAT START");
              //5 Minuten warten
              try
              {     Thread.sleep(5*60000);}          //=5 min
              catch(InterruptedException e)
              String erg="";
              for(;erg.indexOf("STATE STOP")==-1;)
                   erg=hioki.sendStringAndGetAnswer("INTEG:STAT?");
              //Werte in Excel Datei schreiben
              hioki.sendString("HEAD OFF");
              String v=hioki.sendStringAndGetAnswer("MEAS? V");
              String a=hioki.sendStringAndGetAnswer("MEAS? A");
              String freq=hioki.sendStringAndGetAnswer("MEAS? FREQ");
              String w=hioki.sendStringAndGetAnswer("MEAS? W");
              String pwh=hioki.sendStringAndGetAnswer("MEAS? PWH");
              hioki.sendString("HEAD ON");
              v.substring(0, v.length()-2);
              a.substring(0, a.length()-2);
              freq.substring(0, freq.length()-2);
              w.substring(0, w.length()-2);
              pwh.substring(0, pwh.length()-2);
              excelDatei.setS3(v, a, freq, w, pwh);
              System.out.println("s3: U="+v+"V ; I="+a+"A ; Freq="+freq+"Hz ; P="+w+"W ; W="+pwh+"WH");
              erg=hioki.sendStringAndGetAnswer("MEAS?");
              hioki.disconnect();
              return erg;
         private static String s5()
              HIOKI_RS232 hioki=new HIOKI_RS232(port);
              hioki.sendString("*RST");
              hioki.sendString("RESP FAST");
              hioki.sendString("VOLT:AUTO OFF");
              hioki.sendString("VOLT:RANG "+s5MaxVolt);
              hioki.sendString("CURR:AUTO OFF");
              hioki.sendString("CURR:RANG "+s5MaxCurr);
              hioki.sendString("DISP V,A,W,WH");
              hioki.sendString("INTEG:TIME 0,5,0");
              hioki.sendString("INTEG:STAT START");
              //5 Minuten warten
              try
              {     Thread.sleep(5*60000);}          //=5 min
              catch(InterruptedException e)
              String erg="";
              for(;erg.indexOf("STATE STOP")==-1;)
                   erg=hioki.sendStringAndGetAnswer("INTEG:STAT?");
              //Werte in Excel Datei schreiben
              hioki.sendString("HEAD OFF");
              String v=hioki.sendStringAndGetAnswer("MEAS? V");
              String a=hioki.sendStringAndGetAnswer("MEAS? A");
              String freq=hioki.sendStringAndGetAnswer("MEAS? FREQ");
              String w=hioki.sendStringAndGetAnswer("MEAS? W");
              String pwh=hioki.sendStringAndGetAnswer("MEAS? PWH");
              v.substring(0, v.length()-2);
              a.substring(0, a.length()-2);
              freq.substring(0, freq.length()-2);
              w.substring(0, w.length()-2);
              pwh.substring(0, pwh.length()-2);
              hioki.sendString("HEAD ON");
              excelDatei.setS5(v, a, freq, w, pwh);
              System.out.println("s5: U="+v+"V ; I="+a+"A ; Freq="+freq+"Hz ; P="+w+"W ; W="+pwh+"WH");
              erg=hioki.sendStringAndGetAnswer("MEAS?");
              hioki.disconnect();
              return erg;

    Dear fellow members,
    a ex-coworker has written a java applet for my system measuring automation. Unfortunatly it stopped working and i have no idea why. I will write down what the program is supposed to do and what it does. Thank you in advance for all your help, it is really apreciated. And excuse my english, this is not my native language.
    HIOKI = Power consumption measuring device
    The program hiok.jar looks into a specified directory (which is defined in the hioki.ini) for 4 files.
    s0idle.txt
    s0active.txt
    s3.txt
    s5.txt
    First it looks for the s0idle.txt and starts the HIOKI device via the RS232c interface. It sets the voltage, current range etc.. and a integer for 5 minutes. After the measuring is completed it should print out the "resulats" and wait for the s0active.txt which then restarts the measuring process with different values.
    The program used to work just fine, but for some odd reason it does not anymore. The first file "s0idle.txt" is found the measuring is initialized but it never prints out the results or continues to the s0active.txt file. After all 4 measurements are done it should create an xls file.
    Below is the source code and maybe you can help me. Unfortunatly i have ABSOLUTE ZERO knowledge about java. I am not a programmer but have to fix this for my department. looks odd ;-)
    Thanks
    Florian
    package hioki;
    import java.io.*;
    import javax.swing.*;
    * @author Administrator
    public class HIOKI_main {
         * @param args
         private static String mess="";
         private static HIOKI_excel excelDatei=null;
         private static String OutputFolder="C:\\HIOKI-Output";
         private static String InstructionFolder="X:\\Automat";
         private static int s0idleDelay=0;
         private static String s0idleMaxVolt="300";
         private static String s0idleMaxCurr="2";
         private static int s0activeDelay=80;
         private static String s0activeMaxVolt="300";
         private static String s0activeMaxCurr="2";
         private static int s3Delay=80;
         private static String s3MaxVolt="300";
         private static String s3MaxCurr="200.0E-3";
         private static int s5Delay=10;
         private static String s5MaxVolt="300";
         private static String s5MaxCurr="200.0E-3";
         private static String port="COM1";
         public static void main(String[] args) {
              boolean run=true;
              while(run)
                   //ini-File lesen und auswerten
                   File eingabedatei;
                   FileReader fr;
                   BufferedReader br;
                   eingabedatei=new File("hioki.ini");
                   //TODO
                   System.out.println("wait + read: "+eingabedatei.getAbsolutePath());
                   //Datei lesen und in Array abspeichern
                   try{
                        fr=new FileReader(eingabedatei);
                        br=new BufferedReader(fr);
                        String input="";
                        while((input=br.readLine())!=null)
                             if(input.startsWith("OutputFolder:"))
                             {     OutputFolder=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(OutputFolder);
                             else if(input.startsWith("InstructionFolder:"))
                             {     InstructionFolder=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(InstructionFolder);
                             else if(input.startsWith("Port:"))
                             {     port=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(port);
                             else if(input.startsWith("s0idle-Delay:"))
                             {     s0idleDelay=Integer.valueOf(input.substring(input.indexOf(" ")+1)).intValue();
                                  //System.out.println(s0idleDelay);
                             else if(input.startsWith("s0idle-maxVolt:"))
                             {     s0idleMaxVolt=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s0idleMaxVolt);
                             else if(input.startsWith("s0idle-maxCurr:"))
                             {     s0idleMaxCurr=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s0idleMaxCurr);
                             else if(input.startsWith("s0active-Delay:"))
                             {     s0activeDelay=Integer.valueOf(input.substring(input.indexOf(" ")+1)).intValue();
                                  //System.out.println(s0activeDelay);
                             else if(input.startsWith("s0active-maxVolt:"))
                             {     s0activeMaxVolt=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s0activeMaxVolt);
                             else if(input.startsWith("s0active-maxCurr:"))
                             {     s0activeMaxCurr=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s0activeMaxCurr);
                             else if(input.startsWith("s3-Delay:"))
                             {     s3Delay=Integer.valueOf(input.substring(input.indexOf(" ")+1)).intValue();
                                  //System.out.println(s3Delay);
                             else if(input.startsWith("s3-maxVolt:"))
                             {     s3MaxVolt=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s3MaxVolt);
                             else if(input.startsWith("s3-maxCurr:"))
                             {     s3MaxCurr=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s3MaxCurr);
                             else if(input.startsWith("s5-Delay:"))
                             {     s5Delay=Integer.valueOf(input.substring(input.indexOf(" ")+1)).intValue();
                                  //System.out.println(s5Delay);
                             else if(input.startsWith("s5-maxVolt:"))
                             {     s5MaxVolt=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s5MaxVolt);
                             else if(input.startsWith("s5-maxCurr:"))
                             {     s5MaxCurr=input.substring(input.indexOf(" ")+1);
                                  //System.out.println(s5MaxCurr);
                   catch(FileNotFoundException e){}
                   catch(IOException e){}
                   try
                   {     Thread.sleep(2000);}
                   catch(InterruptedException e)
                   File instructionFile=new File(InstructionFolder);
                   if(instructionFile.exists()==true)
                        String[] list=instructionFile.list();
                        for(int i=0;i<list.length;i++)
                             //Wenn Datei mit Namen exit vorhanden ist, dann Programm beenden
                             if(list.endsWith("exit"))
                                  new File(InstructionFolder+"+\\exit").delete();
                                  int ok=JOptionPane.showConfirmDialog(null,"Beenden","found",JOptionPane.OK_CANCEL_OPTION,JOptionPane.INFORMATION_MESSAGE);
                                  if(ok==JOptionPane.OK_OPTION)
                                  {     return;}
                             if(list[i].endsWith("s0idle.txt")==true)
                                  //Excel-Datei initialisieren
                                  try{     excelDatei=new HIOKI_excel();}
                                  catch(IOException e){};
                                  //s0idle Datei �ffnen
                                  instructionFile=new File(InstructionFolder+"\\s0idle.txt");
                                  if(instructionFile.exists()!=false)
                                       System.out.println("s0idle gefunden");
                                       //Hioki mit s0idle starten
                                       try
                                       {     Thread.sleep(s0idleDelay*1000);}
                                       catch(InterruptedException e)
                                       System.out.println("s0idle starten");
                                       mess=s0idle();
                                       System.out.println(mess);
                                       System.out.println("s0idle loeschen");
                                       instructionFile.delete();
                                       //s0active Datei �ffnen
                                       int s0idleExists=0;
                                       for(instructionFile=new File(InstructionFolder+"\\s0active.txt");instructionFile.exists()!=true;instructionFile=new File(InstructionFolder+"\\s0active.txt"))
                                            instructionFile=new File(InstructionFolder+"\\s0idle.txt");
                                            if(instructionFile.exists()==true)
                                            {     s0idleExists=1;
                                                 break;
                                            //2 Sekunden schlafen bis weiter gesucht wird
                                            try{     Thread.sleep(2000);}
                                            catch(InterruptedException e){}
                                       //Wenn s0idle gefunden wird, dann von neuem beginnen
                                       if(s0idleExists==1)
                                       {     break;}
                                       System.out.println("s0active gefunden");
                                       //Hioki mit s0active starten
                                       try
                                       {     Thread.sleep(s0activeDelay*1000);}
                                       catch(InterruptedException e)
                                       System.out.println("s0active starten");
                                       mess=s0active();
                                       System.out.println(mess);
                                       System.out.println("s0active loeschen");
                                       instructionFile.delete();
                                       //s3
                                       s0idleExists=0;
                                       for(instructionFile=new File(InstructionFolder+"\\s3.txt");instructionFile.exists()!=true;instructionFile=new File(InstructionFolder+"\\s3.txt"))
                                            instructionFile=new File(InstructionFolder+"\\s0idle.txt");
                                            if(instructionFile.exists()==true)
                                            {     s0idleExists=1;
                                                 break;
                                            try
                                            {     Thread.sleep(2000);}
                                            catch(InterruptedException e)
                                       //Wenn s0idle gefunden wird, dann von neuem beginnen
                                       if(s0idleExists==1)
                                       {     break;}
                                       System.out.println("s3 gefunden");
                                       //Hioki mit s3 starten
                                       try
                                       {     Thread.sleep(s3Delay*1000);}
                                       catch(InterruptedException e)
                                       System.out.println("s3 starten");
                                       mess=s3();
                                       System.out.println(mess);
                                       System.out.println("s3 loeschen");
                                       instructionFile.delete();
                                       //s5
                                       s0idleExists=0;
                                       for(instructionFile=new File(InstructionFolder+"\\s5.txt");instructionFile.exists()!=true;instructionFile=new File(InstructionFolder+"\\s5.txt"))
                                            instructionFile=new File(InstructionFolder+"\\s0idle.txt");
                                            if(instructionFile.exists()==true)
                                            {     s0idleExists=1;
                                                 break;
                                            try
                                            {     Thread.sleep(2000);}
                                            catch(InterruptedException e)
                                       //Wenn s0idle gefunden wird, dann von neuem beginnen
                                       if(s0idleExists==1)
                                       {     break;}
                                       System.out.println("s5 gefunden");
                                       //Hioki mit s5 starten
                                       try
                                       {     Thread.sleep(s5Delay*1000);}
                                       catch(InterruptedException e)
                                       System.out.println("s5 starten");
                                       mess=s5();
                                       System.out.println(mess);
                                       System.out.println("s5 loeschen");
                                       instructionFile.delete();
                                       //Auftragsnummer abfragen
                                       String antwort=null;
                                       for(;antwort==null||antwort=="";)
                                       {     antwort = JOptionPane.showInputDialog(null, "Messung abgeschlossen!\nAuftragsnummer: ", "Messung abgeschlossen!", JOptionPane.QUESTION_MESSAGE);}
                                       //Excel Datei schreiben
                                       System.out.println("Excel Datei schreiben");
                                       try{     excelDatei.close(OutputFolder, antwort);}
                                       catch(IOException e){}
                                  break;
         private static String s0idle()
              HIOKI_RS232 hioki=new HIOKI_RS232(port);
              System.out.println("start");
              hioki.sendString("*RST");
              hioki.sendString("RESP FAST");
              hioki.sendString("VOLT:AUTO OFF");
              hioki.sendString("VOLT:RANG "+s0idleMaxVolt);
              hioki.sendString("CURR:AUTO OFF");
              hioki.sendString("CURR:RANG "+s0idleMaxCurr);
              hioki.sendString("DISP V,A,W,WH");
              hioki.sendString("INTEG:TIME 0,5,0");
              hioki.sendString("INTEG:STAT START");
              //5 Minuten warten
              try
              {     Thread.sleep(5*60000);}          //=5 min
              catch(InterruptedException e)
              String erg="";
              for(;erg.indexOf("STATE STOP")==-1;)
                   erg=hioki.sendStringAndGetAnswer("INTEG:STAT?");
              //Werte in Excel Datei schreiben
              hioki.sendString("HEAD OFF");
              String v=hioki.sendStringAndGetAnswer("MEAS? V");
              String a=hioki.sendStringAndGetAnswer("MEAS? A");
              String freq=hioki.sendStringAndGetAnswer("MEAS? FREQ");
              String w=hioki.sendStringAndGetAnswer("MEAS? W");
              String pwh=hioki.sendStringAndGetAnswer("MEAS? PWH");
              hioki.sendString("HEAD ON");
              v.substring(0, v.length()-2);
              a.substring(0, a.length()-2);
              freq.substring(0, freq.length()-2);
              w.substring(0, w.length()-2);
              pwh.substring(0, pwh.length()-2);
              excelDatei.setS0idle(v, a, freq, w, pwh);
              System.out.println("s0idle: U="+v+"V ; I="+a+"A ; Freq="+freq+"Hz ; P="+w+"W ; W="+pwh+"WH");
              erg=hioki.sendStringAndGetAnswer("MEAS?");
              hioki.disconnect();
              return erg;
         private static String s0active()
              HIOKI_RS232 hioki=new HIOKI_RS232(port);
              hioki.sendString("*RST");
              hioki.sendString("RESP FAST");
              hioki.sendString("VOLT:AUTO OFF");
              hioki.sendString("VOLT:RANG "+s0activeMaxVolt);
              hioki.sendString("CURR:AUTO OFF");
              hioki.sendString("CURR:RANG "+s0activeMaxCurr);
              hioki.sendString("DISP V,A,W,WH");
              hioki.sendString("INTEG:TIME 0,10,0");
              hioki.sendString("INTEG:STAT START");
              //10 Minuten warten
              try
              {     Thread.sleep(10*60000);}          //=10 min
              catch(InterruptedException e)
              String erg="";
              for(;erg.indexOf("STATE STOP")==-1;)
                   erg=hioki.sendStringAndGetAnswer("INTEG:STAT?");
              //Werte in Excel Datei schreiben
              hioki.sendString("HEAD OFF");
              String v=hioki.sendStringAndGetAnswer("MEAS? V");
              String a=hioki.sendStringAndGetAnswer("MEAS? A");
              String freq=hioki.sendStringAndGetAnswer("MEAS? FREQ");
              String w=hioki.sendStringAndGetAnswer("MEAS? W");
              String pwh=hioki.sendStringAndGetAnswer("MEAS? PWH");
              hioki.sendString("HEAD ON");
              v.substring(0, v.length()-2);
              a.substring(0, a.length()-2);
              freq.substring(0, freq.length()-2);
              w.substring(0, w.length()-2);
              pwh.substring(0, pwh.length()-2);
              excelDatei.setS0active(v, a, freq, w, pwh);
              System.out.println("s0active: U="+v+"V ; I="+a+"A ; Freq="+freq+"Hz ; P="+w+"W ; W="+pwh+"WH");
              erg=hioki.sendStringAndGetAnswer("MEAS?");
              hioki.disconnect();
              return erg;
         private static String s3()
              HIOKI_RS232 hioki=new HIOKI_RS232("COM1");
              hioki.sendString("*RST");
              hioki.sendString("RESP FAST");
              hioki.sendString("VOLT:AUTO OFF");
              hioki.sendString("VOLT:RANG "+s3MaxVolt);
              hioki.sendString("CURR:AUTO OFF");
              hioki.sendString("CURR:RANG "+s3MaxCurr);
              hioki.sendString("DISP V,A,W,WH");
              hioki.sendString("INTEG:TIME 0,5,0");
              hioki.sendString("INTEG:STAT START");
              //5 Minuten warten
              try
              {     Thread.sleep(5*60000);}          //=5 min
              catch(InterruptedException e)
              String erg="";
              for(;erg.indexOf("STATE STOP")==-1;)
                   erg=hioki.sendStringAndGetAnswer("INTEG:STAT?");
              //Werte in Excel Datei schreiben
              hioki.sendString("HEAD OFF");
              String v=hioki.sendStringAndGetAnswer("MEAS? V");
              String a=hioki.sendStringAndGetAnswer("MEAS? A");
              String freq=hioki.sendStringAndGetAnswer("MEAS? FREQ");
              String w=hioki.sendStringAndGetAnswer("MEAS? W");
              String pwh=hioki.sendStringAndGetAnswer("MEAS? PWH");
              hioki.sendString("HEAD ON");
              v.substring(0, v.length()-2);
              a.substring(0, a.length()-2);
              freq.substring(0, freq.length()-2);
              w.substring(0, w.length()-2);
              pwh.substring(0, pwh.length()-2);
              excelDatei.setS3(v, a, freq, w, pwh);
              System.out.println("s3: U="+v+"V ; I="+a+"A ; Freq="+freq+"Hz ; P="+w+"W ; W="+pwh+"WH");
              erg=hioki.sendStringAndGetAnswer("MEAS?");
              hioki.disconnect();
              return erg;
         private static String s5()
              HIOKI_RS232 hioki=new HIOKI_RS232(port);
              hioki.sendString("*RST");
              hioki.sendString("RESP FAST");
              hioki.sendString("VOLT:AUTO OFF");
              hioki.sendString("VOLT:RANG "+s5MaxVolt);
              hioki.sendString("CURR:AUTO OFF");
              hioki.sendString("CURR:RANG "+s5MaxCurr);
              hioki.sendString("DISP V,A,W,WH");
              hioki.sendString("INTEG:TIME 0,5,0");
              hioki.sendString("INTEG:STAT START");
              //5 Minuten warten
              try
              {     Thread.sleep(5*60000);}          //=5 min
              catch(InterruptedException e)
              String erg="";
              for(;erg.indexOf("STATE STOP")==-1;)
                   erg=hioki.sendStringAndGetAnswer("INTEG:STAT?");
              //Werte in Excel Datei schreiben
              hioki.sendString("HEAD OFF");
              String v=hioki.sendStringAndGetAnswer("MEAS? V");
              String a=hioki.sendStringAndGetAnswer("MEAS? A");
              String freq=hioki.sendStringAndGetAnswer("MEAS? FREQ");
              String w=hioki.sendStringAndGetAnswer("MEAS? W");
              String pwh=hioki.sendStringAndGetAnswer("MEAS? PWH");
              v.substring(0, v.length()-2);
              a.substring(0, a.length()-2);
              freq.substring(0, freq.length()-2);
              w.substring(0, w.length()-2);
              pwh.substring(0, pwh.length()-2);
              hioki.sendString("HEAD ON");
              excelDatei.setS5(v, a, freq, w, pwh);
              System.out.println("s5: U="+v+"V ; I="+a+"A ; Freq="+freq+"Hz ; P="+w+"W ; W="+pwh+"WH");
              erg=hioki.sendStringAndGetAnswer("MEAS?");
              hioki.disconnect();
              return erg;

  • Automator Program

    Hi,
    When I start-up a program called Automator flashes a message that my Brother Printer HL-3040CN can't be read as it is corrupted.
    1st I don't know where Automator came from although I do have the MacKeeper program installed and the Icon is similar.
    2nd The Brother Printer was updated from Apple and this Automator message only has appeared since then.
    Can anyone tell me how to either correct the "Corrupted" Brother file or put a stop to this message flashing up each time I turn the iMac on?
    The Printer works fine when needed.
    Maureen

    Hi,
    It's impossible to do this without any script in Automator.
    Use this AppleScript script :
    set source to choose folder with prompt "Select the source folder"
    set anotherfolder to choose folder with prompt "Choose the another folder"
    tell application "Finder"
        repeat with tfile in (get files of source)
            set cDate to creation date of tfile
            set findFiles to (files of anotherfolder whose creation date is cDate)
            if findFiles is not {} then
                set tName to name of tfile
                set name of item 1 of findFiles to tName
            end if
        end repeat
    end tell

  • Creating an Automation program to switch screen resolution?

    Can anybody tell me the steps necessary to create an automation (i.e. just double-click on the icon and it will execute the action) to switch my screen display from whatever it is currently set to,
    to 1280 x 1024 stretched and then have it CONFIRM the setting.
    I change the screen resolutions to a variety of different settings whether I'm playing a game, running a movie off Netflix to my HDTV or just reading and writing email. I know I can turn on the DISPLAY monitor icon on the top right of the screen, click on it and it will show me the most recent settings I've used, and allow me to change it from there, but I'd like to create a automation that will do it with one icon click from the desktop.
    I've got a secondary little keyboard with trackpad that I use when working the computer from the couch for movies and such, but the trackpad is not as easy to manipulate quickly and accurately as the mouse which is back at the mac mini computer, so an automation would speed things up.
    I've tried recording my actions using AUTOMATOR, but when I play it back, it appears to be working (cursor moving to the DISPLAY icon and highlighting the correct resolution) but the screen resolution doesn't actually change as it does when I originally recorded it.
    So I'd like to try it using the correct commands, but I'm still new to AUTOMATOR and can't find SYSTEM PREFERENCES and DISPLAY options commands.
    Any assistance would be appreciated.
    Thanks.

    there i found out how to award the dukes. Now could you help us with the following man, i also need help with the game of life but i have another task to complete.
    here is what i have to do: -
    - write a simple animation in which one or more faces (smiley or sad)bounce around a window.
    - Note that all faces start at a random position in the window, and have a random initial direction (NE, NW,
    SE or SW). The direction of travel of a face only changes when the face bounces off a side of the window.
    - You should ensure that when a face does bounce off the side of the window, its new direction of travel is appropriate (i.e. if it is traveling SW and bounces off the bottom of the screen, it should then be traveling NW).
    - The user should be prompted for the number of faces, and the type of each face (Sad or Smiley) should be chosen randomly.
    - When a face collides with the edge of the window, it should �bounce� as the screenshots illustrate. You can ignore collisions between faces.
    - Each face should be implemented as an object that knows how to draw itself to an JFrame instance.
    - ALL behaviours that are common to both Smiley and Sad faces should be in the Face superclass. This includes most of the drawing routines (e.g. the circle on which the eyes and mouth are drawn, as well as the
    eyes) and the methods for moving the face around the screen and detecting when a face has reached the edge of the screen.
    - Some behaviours will be unique to the subclasses (e.g. the method for drawing the mouth). You should ensure that all classes have a draw method, and that the draw method in the subclasses invokes the draw
    method of the superclass whenever necessary.
    - To achieve the animation, use the following simple algorithm: clear the entire screen, draw all the faces onto the screen, delay for 10 milliseconds, then move each face by exactly one pixel in the direction of travel and repeat.
    Could you please help me do the above.
    i'll award 10 dukes.

  • Is anyone taking an Agile marketing approach to their automation programs?

    I'm in the process of writing a book about marketing modernization and one of the themes in the book is how Agile development practices are impacting how marketers work.  In a nutshell, my thesis is that development organizations have evolved the process by which products/services are developed and this in turn requires that marketers respond by changing how products/services are marketed, sold, and supported.
    If you're not familiar with Agile marketing here are some great resources to check out .... you may be taking an Agile approach without calling it that!
    The Marketing Agility Podcast
    The Agile Marketing Blog
    A New Brand of Marketing
    If you're an Agile Marketer using Eloqua / Oracle I'd love to showcase your story!
    Thanks!
    Roland

    Hi Roland,
    The Marketing Adviser team within the Oracle Marketing Cloud talks to customers about Agile Marketing.  See the Marketing Planning in an Agile World blog post and reach out to Melissa McConnell-Oracle for more information on what we cover with customers as they ask us about agile marketing  (see the full description here of what we cover with customers on this topic). 

  • Automator - How do I: Mouse Click, Move Windows, and more

    Hello,
    I am attempting to create my own Automator programs and for a while I had some that worked nicely. I have recently been tweaking my iMac so that it can "think" on its own (by automator of course) and do things for me. However, I've run across a block with Mavericks (I believe it's due to Mavericks).
    1. How can I get Automator to register a mouse click? "Watch me do" does not seem to want to work for me at all. I also would prefer if it would just be a registered mouse click, but not actually use the mouse (I know this is possible) so that if I'm doing something and it runs, it won't disturb my mouse and I can keep working.
    2. How can I register a keyboard stroke? Same as above
    3. How can I have automator move windows? I have two monitors and there are times when I may want it to move a window from one mintor to another
    The following is a list of all the things I'm attempting to accomplish at the moment (with other things when I think of them) with automator (either through applications, folder actions, or ical actions):
    1. Register a mouse click at a given area or on a given element in a safari page
    2. Register a keyboard stroke in a given program (be able to focus on a program and then do the keystroke)
    3. Move windows from one location to another
    4. Full-screen and Un-full-screen iTunes at certain times of day
    5. Download all purchased items on iTunes that aren't on the computer (sometimes iTunes doesn't download stuff if it was downloaded on my MacBook Pro first)
    6. Automatically voice read reminders (that I've set in Reminders) each day at a given time (I can use loop to repeat it to make sure I hear it all)
    I'll think of more of course, but the mouse click, keyboard stroke, and moving windows is the big thing I'm trying to figure out how to do. Can anyone help?
    Also, I am not a computer tech. I am tinkering with this because it's fun and helpful, but an answer of "just use applescript" or "just use java" will likely just give me a headache. I know that it's going to be one of those codes, but I'm hoping someone has a "base" code that can be copied and pasted that's just a standard click that I can adjust for where I need to click and what process I need to click on.
    If there is an Action Pack that includes a "Register Mouse Click" and/or "Register Keyboard Stroke", then that would work great, but the only action packs for automator I've seen that work with Mavericks is for photoshop.

    You're asking for a lot in one post.  It would be better to break your requests down a bit. 
    For example, to deal with mouse clicks, you can use the Automator Action Run Shell Script with this python script:
    import sys
    import time
    from Quartz.CoreGraphics import *
    def mouseEvent(type, posx, posy):
            theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft)
            CGEventPost(kCGHIDEventTap, theEvent)
    def mousemove(posx,posy):
            mouseEvent(kCGEventMouseMoved, posx,posy);
    def mouseclick(posx,posy):
            mouseEvent(kCGEventLeftMouseDown, posx,posy);
            mouseEvent(kCGEventLeftMouseUp, posx,posy);
    ourEvent = CGEventCreate(None);
    # Save current mouse position
    currentpos=CGEventGetLocation(ourEvent);
    # Click the "Apple"
    mouseclick(25, 5);  
    # 1 second delay       
    time.sleep(1);        
    # Restore mouse position
    mousemove(int(currentpos.x),int(currentpos.y))
    It will look like this in Automator:
    To drag something (i.e. a window, a file icon) from position 40,60 to 60,300:
    import time
    from Quartz.CoreGraphics import *
    def mouseEvent(type, posx, posy):
               theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft)
               CGEventPost(kCGHIDEventTap, theEvent)
    def mousemove(posx,posy):
               mouseEvent(kCGEventMouseMoved, posx,posy);
    def mouseclickdn(posx,posy):
               mouseEvent(kCGEventLeftMouseDown, posx,posy);
    def mouseclickup(posx,posy):
               mouseEvent(kCGEventLeftMouseUp, posx,posy);
    def mousedrag(posx,posy):
               mouseEvent(kCGEventLeftMouseDragged, posx,posy);
    ourEvent = CGEventCreate(None);
    # Save current mouse position
    currentpos=CGEventGetLocation(ourEvent);
    # move mouse to upper left of screen
    mouseclickdn(40, 60);
    # drag icon to new location
    mousedrag(60, 300);
    # release mouse
    mouseclickup(60, 300);
    # necessary delay
    time.sleep(1);
    # return mouse to start positon
    mouseclickdn(int(currentpos.x),int(currentpos.y));
    For keystokes in AppleScript (which can be added to Automator with the Run Applescript Action) see: http://dougscripts.com/itunes/itinfo/keycodes.php

  • HT202879 recently saved a Pages document to Dropbox. Now I cannot open it in the new Pages app, and I cannot use the previous Pages version to open it. Attempting to open the document gives me a flash of a page and then the program crashes. Anybody have a

    I can go to Time Machine and find the document, even read it in Time Machine, but when I try to restore this version I get the same crash. I cannot open with Text or RTF. Preview opens a fuzzy version and can save out as a .PDF, but when I try to convert the .PDF to Word I get a bunch of unusual characters. Any help anyone can give would be greatly appreciated

    OK, I've tried all these tips. Here's what I finally have to do: I open Time Machine. I click on the Pages file and open the Pages file in the Time Machine window. (Restore does not work; nothing works).
    When the Pages file opens, I begin taking screenshots using shift-command-3. I take shots of all 200+ pages of this document. The screenshots are saved to my desktop.
    I then move all 200+ screenshots into one folder, because, face it, that's too many icons to work with on one desktop screen.
    Then I select all the screenshots in the folder at once and open them all in Preview. Then I crop every screenshot using command-K, and save using command-S, and then close that image using command-W.
    When I have cropped all 200+ screenshots, I go back through the folder one by one and adjust the color on each one, moving the mid-range color up to about 75% and the sharpness filter up to about 75%, in order to compensate for the fuzzy image of the screenshot. You can't create a searchable PDF with an image that fuzzy. I do this one by one.
    I make sure everything is saved.
    Then I open all 200+ edited screenshots in Preview and print them out.
    Then I take the 200+ pages of this ****** Pages file and run them through my scanner, making searchable 600 dpi PDFs.
    Then I go to each of the 200+ PDFs and highlight the text, copy, and paste into a NEW word processing document.
    If I'd had 300 pages like the last manuscript, or 700 pages like the one before that, I would have created an Automator program to do all that, but hey, this is not the kind of **** you expect from Apple. Really.  It's taken all week.
    So thanks for your help guys, but no other suggestions worked. I tried to force a download of the file from Dropbox, but got the same result. Besides, my Dropbox folder is saved locally on my harddrive, so it's not their fault. In fact, there is no data in the Dropbox folder under this file name, only preview files. Somehow the Time Machine will open the complete Pages file while in Time Macine, but will not import the saved Time Machine version to the working desktop because it is a preview (i.e., not Preview) image. This is a Pages problem, not a Dropbox problem. Pages did not save the full file.
    If anybody knows a better way to do this, I'd like to know about it. If anybody knows whether I will ever be able to trust Pages again, I'd like to know that too.

  • Applescript works in Automator, but not when app is opened - running all if statements at once?

    Good evening,
    I am new to applescript and have a newbie question regarding the following code. I am making a simple automator program to pull songs from iTunes to practice dancing to. I've started the program with a script that lets the user choose which dances (s)he wants to be played. Then I use applescript to run if statements for each dance, checking whether the dance was selected (and is therefore in "danceList"). If so, I call a separate app to handle finding and playing that dance. The whole thing runs perfectly once opened in automator.
    The problem is when I try to open the app for the first time, whether in finder or in automator -- it calls every single one of the if-statement applications, all at once, before anything else has happened, and thus crashes itself. I have no idea why. I have searched various help sites, tried multiple variations of the if statement code (waltz is an example, below) and making the sub-applications into workflows, but that didn't help.
    Any advice or pointers in the right direction/to appropriate resources would be greatly appreciated.
    Here is a snippet from the relevant code: (didn't include it all, it's the same thing with more if statements)
    on run {danceList}
              if danceList is not null then
                        if danceList contains "Waltz" then
                                       tell application "waltz"
                                                      run
                                       end tell
                                       delay 110
                        else
                                       tell application "waltz"
                                                      quit
                                       end tell
                        end if
                        if danceList contains "Tango" then
                                       tell application "tango"
                                                      run
                                       end tell
                                       delay 110
                        end if
                        if danceList contains "Viennese Waltz" then
                                       tell application "viennese"
                                                      run
                                       end tell
                                       delay 110
                        end if
    ... and so forth ...
        end if
        return danceList
    end run

    Ok, let me try to do a better job explaining.
    I am making this app to simulate the rounds used in competitive ballroom dancing. It lets the user select the dances they will participate in, and then, for each dance, the program reads out the dance title, chooses all songs in iTunes with that genre, selects one at random, starts playing it, waits ninety seconds, and then stops the music. Then a twenty second pause before the next dance. I have made eleven apps for this; one is the main app that calls the others; the others are identical and handle the individual dances.
    Here is all the code I have:
    1. Ask for confirmation - dialogue box explaining app
    2. Get specified text - list of all dances, passed to first section of applescript
    3. First section of script - found on internet, altered for multiple selection; lets user choose multiple dances from a list (code is below pic)
    on run {input, parameters}
    choose item(s) from text
    input: text - items are delimited by paragraphs (returns/newlines)
    output: a list of paragraphs selected
              set output to {}
              set NameList to {}
              set NameList to paragraphs of (input as text)
      activate me
              set TheChoice to (choose from list NameList with title "Choose Dances" with empty selection allowed and multiple selections allowed)
              if TheChoice is false then
                        error number -128 -- cancel
              else
                        set output to TheChoice
              end if
              return the output -- pass the result to the next action
    end run
    4. Store value of variable as "danceList" - probably unnecessary but gave it a name
    5. Second section of applescript - what's been discussed previously, here's the full code:
    on run {danceList}
              if danceList is not "" then
                        if danceList contains "Waltz" then
                                  tell application "waltz"
                                            run
                                  end tell
                                  delay 110
                        end if
                        if danceList contains "Tango" then
                                  tell application "tango"
                                            run
                                  end tell
                                  delay 110
                        end if
                        if danceList contains "Viennese Waltz" then
                                  tell application "viennese"
                                            run
                                  end tell
                                  delay 110
                        end if
                        if danceList contains "Foxtrot" then
                                  tell application "foxtrot"
                                            run
                                  end tell
                                  delay 110
                        end if
                        if danceList contains "Quickstep" then
                                  tell application "quickstep"
                                            run
                                  end tell
                                  delay 110
                        end if
                        if danceList contains "Samba" then
                                  tell application "samba"
                                            run
                                  end tell
                                  delay 110
                        end if
                        if danceList contains "Cha cha" then
                                  tell application "chacha"
                                            run
                                  end tell
                                  delay 110
                        end if
                        if danceList contains "Rumba" then
                                  tell application "rumba"
                                            run
                                  end tell
                                  delay 110
                        end if
                        if danceList contains "Paso Doble" then
                                  tell application "paso"
                                            run
                                  end tell
                                  delay 110
                        end if
                        if danceList contains "Jive" then
                                  tell application "jive"
                                            run
                                  end tell
                                  delay 110
                        end if
              end if
              return danceList
    end run
    Here is the code for the waltz app. All the other dance apps are identical; they just search for different terms and have a different introduction spoken.
    1. Get specified text - "Next Round is the Waltz, etc."
    2. Speak text - reads text out loud so people know what's next
    3. Find iTunes tracks where genre is "Waltz" or "waltz"
    4. select these tracks
    5. store all these in variable "tracks"
    6. applescript to pick a random track from "tracks":
    on run {tracks}
              set maxNumber to count of tracks
              set randy to random number from 1 to maxNumber
              set chosenTrack to item randy of tracks
              return chosenTrack
    end run
    7. 3 second pause between speech and music
    8. Start playing the chosen track
    9. 90 second wait while track plays
    10. pause itunes (stop music)
    11. end app
    Again, my concern here is why the program runs fine once it has already been opened in automator (say second or third time running it there) but when run from finder, or first opened in automator, it calls all the dance apps at once. Then they give error messages because the speech section is first, and this can't be done simultaneously:
    Also, not sure if this is relevant, but I have a spinning gear in the corner of my mac that I believe is automator launcher, and it's showing all the apps as running even after I've ok'd their error messages and they have disappeared from the dock. I can exit waltz and danceApp, which are the two actually running, but the others won't stop until I've ended automator launcher in activity monitor.
    Hopefully this is more helpful. Thanks again.

  • Insert or Cut Time and move automation data - how to do it?

    Hi when I cut or insert time it moves the regions but not the automation data. I have tried switching nn 'move automation with regions' but it doesn't move the automation that goes past the end f regions eg plug in settings like delay feedbacks etc.
    a) this seems to me to be really crazy - why if you had done a lot of detailed automation programming at the end of a song would you not want it to move if you cut 4 bars from earlier on in the song?
    any ideas appreciated very much!!
    best
    tommy b

    after using logic for years I have discovered a new bit and something very weird.
    New Bit:
    As well as Cut/Insert Time in the Region Menu
    there is a Cut/Insert Time in the Edit menu.
    if I start here:
    http://www.applebananacarrot.com/downloads/pre.jpg
    if I do the region Cut ( from the region menu on the arrange window):
    look what happens to the automation data on track 21
    http://www.applebananacarrot.com/downloads/postregioncut.jpg (track 21 data didn't move)
    and compare it to this one doing everything else the same but using the Cut from the main logic edit menu.
    http://www.applebananacarrot.com/downloads/posteditcut.jpg Track 21 automation data did move.
    That to me seems wrong....
    whaddya think?
    best
    tommy banana

  • Code insert in ABAP program

    Hi all,
    How can i insert a single line of code in background? This needs to be done for thousands of objects. Also, we need to capture all the changes in a single TR. Is there is any automation program available to update these objects.
    Thanks,
    Stanley
    Moderator warning - Please be aware of the potential danger such a solution can pose.
    Message was edited by: Suhas Saha

    There are a number of statements available for dynamic programming that permit you to read programs into an internal table, change the internal table and write the programs back. You only need to read the ABAP help to find them.
    You must ensure safety and that you test on a sandbox system first. A program such as you suggest must never be available in production. It must be coded to prevent changes being made to any program outside the customer namespace.
    There are various function modules, easily found, that will allow the changes to be stored in a transport.
    A common requirement is to add code to all programs that gives information about their use. Such a requirement is easily met by the source code coverage analyser (SCOV) which has a counterpart (UPL or something, or SCOV-lite) that can be run in production without affecting performance.
    If this isn't your requirement, then perhaps if you shared it, we'd be able to come up with a solution that doesn't require automatic code replacement and all the risk that entails.

  • Network copying that has no problem in Finder doesn't work in Automator

    Hello,
    there seems to be an issue with open files:
    If I drag a folder containing some open files from a mounted Windows 2003 server share onto my desktop in 10.6, then copying works fine even though files are open. 10.4. works the same, but not 10.5, I get permission errors there.
    If I try do do the same with an automator program, then there will be an error message like 'file xyz couldn't be created'. In 10.4 an automator programs doing the same works fine.
    Is there a trick to copy open files in automator with 10.6?
    Thanks for your help.
    -Hans

    This is not a feature of iPhone, iPad or iOS.
    Bluetooth is supported for stereo headsets/speakers, handsfree telephone
    devices/headsets, some keyboards, some peer-to-peer apps from the
    app store and internet tethering where provided by the carrier.
    Other than this it will not connect to a phone/computer/device.  (thanks to ckuan for the wording)

  • Multi step program

    Dear all,
    As a newbe here i would like to know if somebody reconizes this problem.
    I think i am looking for the obvious, though i cann't find it. In labview i would like to do the following:
    make  a screen in which a user can make a automated program to run his reactor overnight.
    the program needs to be time controlled but also settings controlled.
    it is going to be for the control of a reactor which uses gasses and temperature
    and certai ntime the temperature should change and or the gas flow.
    does anybody has a idea to solve this problem?
    kind reagards
    vincent koot

    Well said, Gabi1.
    Your first step should be the design.  Describe how you want it to work, and describe any daily routine that can be translated into a profile.  You can write the software to load a given profile which means flexibility for the future.. 
    All this takes place in the upfront design process.  Don't rush into coding before it is clear what you want to do and how..
    RayR

Maybe you are looking for

  • 9.0.1 won;t allow a pdf to open without locking up; I want an older version

    After downloading 9.0.1 I can't open a pdf I was previously able to open. Even worse, once I try, everything on the page becomes immune to my cursor and when I close the browser and try to reopen, even hours later, I'm told Firefox is already running

  • How do I get the loaded file_name into a variable?

    Hi, I am busy loading multiple flat files into my Oracle Database. I have defined a File Format for this and it works fine. However, there is a FILE_NAME field in my table, which should contain the name of the file where a specific record was loaded

  • Unable to install a Solaris OS in a Single disk slice

    Hi, We are unable to install the Solaris-OS on a single slice disk. We found that, only "Solaris 10 10/08 (U6)" release can support the single slice disk installation, prior release are not. Is it true ? We found it from "LDoms Community Cookbook " ,

  • How to adjust power output of time capsule

    I was told that the power output of the time capsule is adjustable and that Apple does not ship the units at full power. Is this correct?

  • AAMEE Created MSIs

    right I have used AAMEE 3.0  to create MSis for CS6 Web Premium - all components, these have been deployed via sccm to about 30 users in the last 3 months.Will they be affected ? - can going into photoshop and help\update fix the problems ? Thanks Ed