How to pass command-line options to app using the "open" command?

I am using jedit, and since I'm doing a lot of stuff in a shell, I'd really like to launch it from the command line as though I'd opened from finder, so I wrote a script that contains this:
open -a /Applications/Jedit.app "$@" &
This works well for everything except NEW files, where I get this error:
2007-02-16 19:29:48.072 open[1032] No such file: /Users/millerti/projects/ateon/new_file
Is there a way I can override this?
So, it occurred to me that I might try running jedit directly this way:
/Applications/Jedit.app/Contents/MacOS/jedit -- "$@" &
The trouble is that this suffers all sorts of weird problems. For instance, if there's already a jedit running, it launches another one (despite the fact that -server is default). Moreover, the file it opens, existing or not, is not the one I specify. If I'm in ~/mydir and I open ./myfile, jedit opens instead /Applications/myfile.
Obviously, I'm doing something wrong. Can someone help me figure out what open is doing internally so that I can launch jedit compatible with how open does it so that I can both open existing files and create new ones the same way from the command line?
BTW, I can make more complex script.
Also, if this isn't the right forum for this, can someone tell me where would be a better place to get the question answered?
And I'm not expecting to get jedit support here. This isn't a jedit problem because it's behaving correctly.
Thanks.

Applications rarely take command line arguments. I don't know anything about Jedit, whether that is an exception, but you are not sending an argument to Jedit with the open command. The file name on your command line is an argument to the open command. The open command says "open this file with the specified application". The application doesn't see the argument. It sees the file exactly as if it were opened from the Finder. That's why naming a non-existent file doesn't work.
What if you open Jedit with no file, create a new document in the application. (Again, I am not familiar with Jedit.)

Similar Messages

  • How do i figure it out what app use the cellular data in standby mode?

    How do i figure it out what app use the cellular data in standby mode? I disabled the cellular data for 3 days, and my battery last longer. I don't use push notifications, neither location services. I'm not signed in in skype or any IM app.

    Do you use push email?  Do you have accounts that have synchronized calendars associated with them?  Those features will still use cellular data in the background as the receive mail and send or receive calendar updates.
    Some notifications, like push notifications from Facebook and other social networking sites may use cellular data in the background.  Basically, any automated data task like those may use cellular data when the phone is in standby (note that wifi would be used if available when the phone is active, but wifi turns off in standby and all data goes through the cellular data connection).

  • HT1711 How do I update new versions of Apps using the new iTunes?

    Good day all. I am having problems downloading updated versions of some Apps using the new iTunes. How do I update new versions of Apps using the new iTunes?

    You can go back to the old view with the left-hand sidebar via View > Show Sidebar (if you are on windows then alt-v should show the View drop-down menu) - which is what I'm currently doing as I'm familiar with that way.
    Or, on the new view you can click on the library type at the top left and select Apps and then Check For Updates at the bottom right of the screen. When you've downloaded the updates to your computer, click on Library top right to go back to your library view from the store, then select the iPad (top right) and Sync at the bottom right should then copy the updates to your iPad.

  • Is there any command line option, so that when I open firefox from command line it uses the already opened firefox, instead of creating a new firefox window.

    for example: this option is available with jedit editor.
    jedit
    above cmd always opens a new jedit instance.
    jedit -reuseview
    above cmd checks if there is a existing jedit instance if yes brings it to focus else opens up a new one.

    Start your '''Computer''' in safe mode with networking. Then start Firefox.
    After a bit, close it. Then open it a few minutes later.
    '''[http://encyclopedia2.thefreedictionary.com/Linux+Safe+Mode Starting The Computer In Safe Mode;<br>Free Online Encyclopedia]'''

  • Is there a command-line option that will override the "show my windows and tabs from last time"?

    A friend of mine occasionally runs into a web page that causes him problems. To be sure, he should note the URL and submit a bug report if a page causes a browser crash, but in any case, while by default he likes the browser to restore windows and tabs from the previous session, in the case of an obnoxious web page, you *don't* want that to happen. I'm hoping that I can set up an icon for him to click on that will start the browser up on his home page instead of restoring previous windows and tabs when he gets into trouble.

    Set the Integer pref browser.sessionstore.max_resumed_crashes to 0 on the about:config page to get the about:sessionrestore page immediately with the first restart after a crash has occurred or the Task Manager was used to close Firefox.
    * http://kb.mozillazine.org/browser.sessionstore.max_resumed_crashes
    That will allow you to deselect the tab(s) that you do not want to reopen, but will allow to reopen other tabs.
    See:
    * http://kb.mozillazine.org/Session_Restore#Restoring_a_session_after_a_crash
    * http://kb.mozillazine.org/Browser.sessionstore.max_resumed_crashes

  • Command line options in Jar files?

    Can I set a command line option in the manifest of my jar file so that when it is double clicked it will invoke the JVM with my command line option??

    Trying to pass to the JVM, not my code.I see.
    Actually I wish sun would just fix the dang option towork
    as it should and not need to be on the commandline...
    And that won't happen.
    Your presumption is that the manifest could somehow do
    the command line options. But by the time the
    manifest and jar file is read, the JVM is already
    running and fully functional. Most of the
    functionality that you see in the jvm is actually
    implemented by other java classes. So the JVM has to
    be running before it can do anything.
    With sun jdk 1.3 a hello world program loads 180+
    classes. This is not pre-loading but rather load on
    demand, it needs all of those classes to load, resolve
    and run the hello world program.
    Actually I am aware of the classes which implement this functionality. It would be VERY easy for sun to empty the connection cache, they just choose to not let us do it for whatever bonehead reason. ANYONE who uses an internet inabled java application/applet will have this issue. Is java supposedly internet friendly?
    Just try it. unplug your internet, use a java application to try and connect to some URL (telnet, ftp, whatever). Plugin your internet connection and see that you will not be able to connect untill you restart your app.
    Crazy. This should be implemented. Its got 2 be a bug. they dont even tell you its command line only...

  • Command line options / API Support to launch the sequence file

    does teststand support any command line options / API Support to launch the sequence file and also populate the test run status. I want to explore the option of integrating the teststand with QC where I can launch the sequence from QC and results are sent back to QC.
    Thanks in advance,
      -Dilip

    Hi Dilip,
    Here are the command line options for TestStand v4.2.1:
    Command Line Processing
    Command line usage:
       seqedit.exe [<sequence file>]
                   [/goto <location>]
                   [/run <sequence> <sequence file>]
                   [/runEntryPoint <entry point> <sequence file>]
                   [/quit]
                   [/setCurrentDir]
                   [/useExisting]              
                   [<workspace file>]
          <location>:  property object path to the item to display in the file
                   Location examples:
                         TestExec.exe c:\example.seq /goto "Seq[\"MainSequence\"].Main[\"Power On\"]"
                         TestExec.exe c:\example.seq /goto "Seq[\"MainSequence\"].Main[\"ID#:JifH4ODTf0y1z7bJ​ne0G7D\"]"
                         TestExec.exe c:\example.seq /goto "Seq[1].Main[4].TS.LoadOpt"
          <sequence file>:  sequence file to open
          <sequence>:       sequence to run
          <entry point>:    entry point, such as Single Pass or Test UUTs, to run
          <workspace file>: workspace file to open
       You may specify multiple sequence files, sequences, and entry points.
       Quotes are required for arguments that contain a space, such as
       "Test UUTs" and "C:\My Documents\Test Sequence.seq"
    I don't believe you'll get a return status of the executed sequence from the editor on close; but you could design your sequence to write the status to a file and then read that by your QC application.
    -Jack

  • How to pass command line options?

    I know that command line options contrary to command line data arguments start with a prefix that uniquely identifies them.
    I write an application that will copy files from one folder to another. It should be launched with the syntax as follows:
    c:>java my.app.DirectoryScannerConsole
    c:>scan ?input ?C:/test/in? ?output ?C:/test/out? ?mask ?*test*.xml? ?waitInterval 60000 ? includeSubfolders false ?autoDelete true
    c:>exitSo after launching we have two commands: 'scan' and 'exit'. What should I make in my program to be able to invoke these commands in such a manner?
    Edited by: Exaserge on Nov 8, 2008 10:38 AM
    Edited by: Exaserge on Nov 8, 2008 10:40 AM

    Maybe try using Scanner to read in the line of input, then break the line into an String array, then comparing the Strings in the array.
    Something like...
    public static void main(String args[])
       Scanner in = new Scanner(System.in);
       String line = in.readLine(); //read in an entire line of input
       String words[] = line.split(" "); //split that line wherever there is a space
       while ( !(words[0].equals("exit")) ) //if they haven't typed in exit
          if (words[0].equals("scan")
              if(words[1].equals("-input"))
                 String inputFile = words[2]
              //etc.
          line = in.readLine();
          words = line.split(" ");
    }I haven't tried to compile it or anything, so it may not be syntactically correct, but you should get the idea.
    Edited by: chickenmeister on Nov 8, 2008 1:02 AM

  • How to compile an .air app from the ADT command line?

    Hi,
    I would like to compile an .air app from the ADT command line.
    Does anybody have an example?
    I don't know how to add the AIR SDK path and a folder to it.
    Is there a generator for the command line availabble?
    Thanks

    Correction: it seems that Applescripts and some similar scripts can be called from the command line using "osascript scriptname". I don't speak automator but you might like to try it. osascript seems to come with severe limitations though, for instance it doesn't allow user interaction such as dialogue boxes.

  • How do I restart the SNMP agents with the original command line options?

    I'm creating an application that changes the SNMP trap target configuration files and then restarts the SNMP agent. I'm currently working with the mibiisa agent. I want to make sure that I restart the service with the new trap targets but with the original command line options. How can I restart the mibiisa service with the same command line options that it originally loaded with?

    It is not "Network Time" that is the problem, but actually "SystemStarter." SystemStarter is an interim kludge to enable the work or the old StartupItems until they can be converted to LaunchDaemons or LaunchAgents controlled by launchd. Launcd calls SystemStarter to launch all the unconverted StartupItems. ntpd is now under the control of launchd directly.
    Launchctl is the command to load and unload the plist files, but I don't think it has a mechanism to restart a daemon.
    There are start and stop commands in launchctl, but the man page indicates that they are for debugging purposes.
    I also imagine you could just kill the ntp daemon and let it restart with new settings. It is most likely set to "keepAlive" so that it will automatically restart.

  • Javadoc command line options

    I have a custom doclet which generates xml output instead of the default ouput from javadoc.
    I am trying to pass custom command line options to my custom doclet class.
    The following is my javadoc command:
    javadoc -classpath c:\junit\junit3.8.1\junit.jar;C:\j2sdk1.4.1\lib\tools.jar -doclet DocGenerator -dest c:\docgen\temp C:\DocGeneratorTest.java
    When i use the above command i get the following error:
    javadoc: invalid flag: -dest
    I am trying to access the value of dest in my custom doclet.
    Regards
    -rv

    Perhaps the following will help. It explains how to use command-line options
    Any doclet that uses custom options must have a method called
    optionLength(String option) that returns an int. For each custom
    option that you want your doclet to recognize, optionLength must
    return the number of separate pieces or tokens in the option. This page gives an example:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/overview.html#options
    -Doug Kramer
    Javadoc team

  • Command line options in executable jar

    Hello,
    On a win32 system I have an executable jar that the user dbl clicks to run.
    What I would like to do is maintain this simple dbl click to run but have command line options passed to the vm. ie I would like the dbl click to invoke
    javaw -Xms60m -Xmx120m -jar myjarfile.jar
    rather than just
    javaw -jar myjarfile.jar
    Can these options be placed in the jar files manifest? If so how? (I can't see how to do it)
    Many thanks
    Mike

    why not use special .jar tool to help you to save much
    of your time?
    Thanks for the idea but it really doesn't answer my question.
    Mike
    [Edited by: jdcforumadmin1 on Jun 24, 2002 1:39 PM]

  • Command line option to specify Bridge master cache

    Please allow a bridge command line option to allow the user to select a specific bridge master cache.
    The  motivation is as follows:  I have written a c++ programme to key-word  all of my many thousands of photo projects.  Essentially each project is  in a separate directory on 8 terabytes of networked disk.  Associated  with each directory is a set of key words.  When the appropriate project  is selected, I invoke Bridge to open that directory, possibly with a  specific images as the "starting image" for that project.  Since the  master cache files are split (to accomodate the 500,000 max image count  supported by bridge), it would be excellent if I can pass a reference to  the specific master cache associated with that directory.
    A second value of this option would allow the user to create desk-top short-cuts to invoke bridge using an appropriate cache structure.  For example, the properties of one short cut could specify the cache file for the current daily use of the Bridge to process images in progress.  A second could point the the cache associated with the historical first 400,000 image archived on the network, and a third could invoke bridge pointing to the cache for the next 400,000 image cache - or whatever grouping the user needs to match his workflow when using Bridge as the central focus for various digital assets..
    This type of processing allows the user to conveniently invoke bridge according the the needed work flow when multiple cache systems are required.  In addition, the multiple desk-top shortcuts would minimize the "error" of having bridge pointed, by accident/neglect, to the incorrect cache structure.
    It would also be valuable to allow the user to display the current number of actual image items in a cache system - either as a "view" or "tools" option.  This would allow the user to know when it is time to start a new master cache system. Of course, this can be intependently viewed in windows explorer by the count of files in the 1024 or 256 directories - however maybe the cache structure already "knows" this number instantly.  Other statistics could be interesting as well - possibly the number of directories known to the cache (possibly the same as the count of directories within the 1024 or 256 directories). Possibly the number of files cached by file type (jpg, tif, psd, cr2, nef, etc) would be of interest to some folks - however, such things should be user-selectable since such analysis might be time intensive and maybe of no interest.
    Of course, I do not know if this is consistent with other uses of Bridge - this request is made based upon my use of Bridge as a still photographer and a few videos I have created.
    thank you....
    tony

    I'm going to be technical for a minute, just for the Forum archives...
    The Library file location is stored in your "iTunes Prefs.xml" file in<pre>%APPDATA%Apple ComputeriTunes</pre>.
    Actually, I should say that if you are using a non-default location, there is a key for "iTunes Library Location:1", e.g.:
    <key>iTunes Library Location:1</key>
    <data>
    QwA6AFwARABvAGMAdQBtAGUAbgB0AHMAIABhAG4AZAAgAFMAZQB0AHQAaQBu
    AGcAcwBcAFQAZQByAGkAZABvAG4AXABNAHkAIABEAG8AYwB1AG0AZQBuAHQA
    cwBcAE0AeQAgAE0AdQBzAGkAYwBcAHQAZQBzAHQAbABpAGIAcgBhAHIAeQA=
    </data>
    The "data" is a base64-encoded UTF16-LE string that is the folder containing the "iTunes Library.itl" file and "Album Artwork" folder. In the above case:<pre>C:Documents and SettingsTeridonMy DocumentsMy Music     estlibrary</pre>
    The key/data pair does not exist if you're using the default Library location.
    Similary, there is a key/value pair for "iTunes Library XML Location:1" -- except this part always appears, even if you are using the default location. Also, it is the full path to the file itself, not just the directory containing it. e.g.:<pre>C:Documents and SettingsTeridonMy DocumentsMy Music     estlibraryiTunes Library.xml</pre>
    Since it doesn't appear that double-clicking on the Library file you want to open works, I'm guessing the only way to swap locations is to edit the preferences file -- either directly, or with a script/program. I could probably write such a program in a 1/2 hour or so... I might just do that right now.

  • File name as command line option for multiple VM processes

    "-Xloggc:/tmp/gc.log" is the option I'd like to set, but every process will log to that file and even if we don't experience any concurrency issues the data still isn't useful because I can't tell which process did what.
    The island files are cleverly named to include their process number, can I do similar for command line options or will I be restricted to a single JVM?

    Online help (as of LabVIEW 7.0?), Index, Command Line, User-defined arguments - It will show you the following:
    You also can pass LabVIEW-defined or user-defined arguments when you launch LabVIEW from the command line. To pass user-defined arguments in the command line, enter two hyphens (--) surrounded by spaces before the set of user-defined arguments. LabVIEW does not use any arguments after the two hyphens to launch labview.exe. LabVIEW passes the arguments after the two hyphens to the block diagram of the VI you launch. Use the Application:Command Line Arguments property to read the user-defined command-line arguments passed when LabVIEW launches.
    For example, to launch mycool.vi and pass user-defined arguments, use the following command:
    c:\labview\la
    bview.exe c:\coolapp\mycool.vi -- 1000 sine
    On the block diagram of the mycool.vi, use the Application:Command Line Arguments property to read the 1000 and sine arguments you passed and handle the values.
    Enjoy,
    Roy

  • JDev specifying SQLJ translator command line options

    Hi,
    I have come across the problem of SQLJ connections caching up to 5 sql commands and so leaving any related cursors open. This is happening mainly for statments where I have executed a SELECT ... INTO ... Any sqlj with iterators, I have closed the iterators so they do get removed and their cursors closed.
    I have found that caching can be switched off via the SQLJ translator command line option -P-Cstmtcache=0.
    How can I specify this command line option within my JDeveloper project settings? I don't want to have to build my project from the command line explicitly as this will complicate the Release Software Build procedure.
    Can anyone help me, please?
    Thanks a lot.

    Can anyone offer any words of wisdom on this? We are currently using JDeveloper 3.1 (Build 681)

Maybe you are looking for

  • Printer won't switch from one tray to another

    Having problems with my HP Officejet Pro 8600 Premium not doing the auto switch from default tray to next tray during print job.  I've tried unplugging the printer, removing and replacing tray 2, checking for jams, shuffling paper, resetting the defa

  • ITUNES 7 UPDATE

    HI THERE SINCE I UPDATED TO ITUNES 7 I AM NO LONGER ABLE TO LOAD THE PROGRAM, I GET MESSAGE , ITUNES LIBARY CANNOT BE READ BECAUSE IT WAS CREATED BY A NEWER VERSION??

  • Material group Vs G/L account

    Hi experts, Where I can found the detials of material groups and it's associated G/L account details. Thanks and advance, Regards, krish

  • Restriction to component selection in Service Order

    Hi, Scenario is a Repair Technician selects a Fault Code in the Notification. Component entry (Part consumption) in the Service Order is allowed only if the selected Fault Code requires a Part replacement. Is it possible to restrict component selecti

  • I cannot open any pdf files! I used to be able to. Have a mac.

    I cannot open any pdf files. I used to be able to. If I open them I get a blank screen. Have a mac. Help!!!!!