Default arguments for filetype

Is there a way to always feed an application certain command line arguments when opening a certain file type.
For example: I save vim session files as .vis. I want to double-click the file in finder and have it run "mvim -S [filename].vis"
Thanks!

the way to do that would be to make your own meta application. that's easy to do with automator. start automator and choose to make an application. the workflow itself should consist of the following single 'run shell script" action
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
for f in "$@"
do
/path/to/mvim -S "$f" &
done</pre>
put the full path to the unix executable for mvim in the command. save the application. then choose a .vis file, in finder and enter command+i. in the resulting popup go to the open with section and change it to be open by the application you made. then click "change all".

Similar Messages

  • Possible to do default argument for method?

    Hello,
    Is it possible in JAVA to give default argument to method as in c++?
    I have a method that I want to call with only part of the argument:
    public String UpdateTrs(String amount, String RefNo1, String RefNo2=null)
    so if I have RefNo1 and no RefNo2 I could call as UpdateTrs("333", "12222"),,,
    thanks.

    Here's an example to elaborate:
    // Here's your original method:
    public String UpdateTrs(String amount, String RefNo1, String RefNo2) {
        // method implementation here
    // This overloads it to add the "default" value.
    public String UpdateTrs(String amount, String RefNo1) {
        UpdateTrs( amount, RefNo1, null);
    }This accomplishes the same thing.
    Namely, calling the method with two parameters results in the third parameter being null.
    Hope that's helpful.
    Dave

  • Default argument for main method

    Dear All,
    What default value will be supplied to main method incase we are not sending any argument from command Line..
    Rgrds
    Ravi. N

    > this indicates that we can invoke a main method
    without passing any actual argumnets
    [EDIT] Only in the case of varargs, which you can declare your methods with, if you wish.
    Example:class Foo {      
        public static void main(String[] args) {
            // Bar.main();  <--- won't compile
            Baz.main();
    class Bar {
        public static void main(String[] args) { }
    class Baz {
        public static void main(String... args) { }
    }~

  • Default value for a reference cursor argument to a package function

    I'm trying to do the following to allow the caller to pass in a ref cursor arg or a SrcTextID (internal). Anyway, I'm just trying to use defaults, rather than overloading the routine, but I can't figure out how to default a ref cursor variable.
    FUNCTION f_execute_query_and_build_file(
         bn_debug_mode_in                              IN           common_func.BOOLEAN_NUMBER,
         n_ahs_file_definition_id_in          IN           AHS_FILE_DEFINITION.AHS_FILE_DEFINITION_ID%TYPE,
         lst_ordered_column_names               IN           common_func.STRING_TABLE,
         s_file_directory_in                         IN           VARCHAR2 := null,
         s_file_name_in                                   IN           VARCHAR2 := null,
         n_src_text_query_id_in                    IN           SRC_TEXT.SRC_TEXT_ID%TYPE := Null,
         refcur_query_in                              IN           sys_refcursor := Null,
         s_error_msg_out                                   OUT      common_func.T_ERROR_MSG )
    RETURN NUMBERThis causes a "PLS-00382 expression is of wrong type" msg. Okay, so fine. Then I thought that I would declare a package level "empty" ref cursor to act as "empty" default...which causes a "PLS-00994 Cursor Variables cannot be declared as part of a package" msg.
    Any ideas?
    Thanks,
    Jason

    in 10g you can...Unfortunately 9i doesn't like it:
    scott@ORA92> DECLARE
      2    variable_name SYS_REFCURSOR := NULL;
      3  BEGIN
      4    NULL;
      5  END;
      6  /
      variable_name SYS_REFCURSOR := NULL;
    ERROR at line 2:
    ORA-06550: line 2, column 34:
    PLS-00382: expression is of wrong type
    ORA-06550: line 2, column 17:
    PL/SQL: Item ignored
    scott@ORA92> DECLARE
      2    PROCEDURE procedure_name (
      3        parameter_name IN SYS_REFCURSOR := NULL)
      4    IS
      5    BEGIN
      6        NULL;
      7    END;
      8  BEGIN
      9    procedure_name;
    10  END;
    11  /
        parameter_name IN SYS_REFCURSOR := NULL)
    ERROR at line 3:
    ORA-06550: line 3, column 40:
    PLS-00382: expression is of wrong type
    ORA-06550: line 2, column 3:
    PL/SQL: Item ignored
    ORA-06550: line 9, column 3:
    PLS-00306: wrong number or types of arguments in call to 'PROCEDURE_NAME'
    ORA-06550: line 9, column 3:
    PL/SQL: Statement ignored
    Barbara what is the difference between 'DEFAULT' and
    ':=' in parameter declarations?Apparently there is no difference. My mistake. I have always used default. Somewhere along the way I obtained the misimpression that using := would overwrite a passed value, similar to the way it would when used between is/as and begin, whereas default would only use the default value if another value was not passed. I don't recall where I got that idea. The test below shows that my presumption was wrong:
    scott@ORA92> CREATE OR REPLACE PROCEDURE test
      2    (p_1 IN VARCHAR2 DEFAULT 'default value for p_1',
      3       p_2 IN VARCHAR2 := 'defualt value for p_2')
      4  AS
      5  BEGIN
      6    DBMS_OUTPUT.PUT_LINE (p_1);
      7    DBMS_OUTPUT.PUT_LINE (p_2);
      8  END test;
      9  /
    Procedure created.
    scott@ORA92> SHOW ERRORS
    No errors.
    scott@ORA92> SET SERVEROUTPUT ON
    scott@ORA92> EXECUTE test ('passed value for p_1', 'passed value for p_2')
    passed value for p_1
    passed value for p_2
    PL/SQL procedure successfully completed.
    scott@ORA92>

  • ORA-02315: incorrect number of arguments for default constructor

    I was able to register the XML schema successfully by letting Oracle creating the XML Types. Then when I try to execute the create view command the ORA-02315: incorrect number of arguments for default constructor is always raised.
    I tried using the XMLTYPE.createXML but it gives me the same error.
    Command:
    CREATE OR REPLACE VIEW samples_xml OF XMLTYPE
    XMLSCHEMA "http://localhost/samplepeak4.xsd" ELEMENT "SAMPLE"
    WITH OBJECT ID (ExtractValue(sys_nc_rowinfo$, '/SAMPLES/SAMPLE/SAMPLE_ID')) AS
    SELECT sample_t(s.sample_id, s.patient_info, s.process_info, s.lims_sample_id,
    cast (multiset(
    SELECT peak_t(p.peak_id, p.mass_charge, p.intensity, p.retention_time,
    p.cleavage_type, p.search_id, p.match_id, p.mass_observed,
    p.mass_expected, p.delta, p.miss, p.rank, p.mass_calculated,
    p.fraction)
    FROM peak p
    WHERE s.sample_id = p.sample_id) AS PEAK107_COLL))
    FROM sample s;
    Can someone help me.
    Thanks
    Carl

    This example runs without any problems on 9.2.0.4.0. Which version are you running? And which statement causes the error message?

  • How can I make a default border for a JWindow?

    I have a JWindow object that is created when a button is pressed in a JFrame. I want the JWindow to have the same type of border as the JFrame from which it's created. However, the JWindow is not created automatically with a border as the JFrame is, so I don't know how to set the border abstractly so that whatever border is used for the JFrame, per he default L&F, will also be used for the JWindow.
    I tried grabbing the border object from the JFame instance itself, but there is no such field in JFrame or any of its ancestor classes. I looked at UIDefaults, but I have no idea how this class can be used to get what I want. For example, if I use UIDefaults.getBorder(Object obj), what do I specify for the argument?
    I'd be happy with an abstract or a concrete solution. That is, either using the default Border for top level containers in the current L&F, or by grabbing an actual Border instance from a JFrame object.
    -Mark

    Also, I'm curious why you said that JFrame is not a swing component.A Swing component extends JComponent. Basically this means that all the painting of the component is done in Java. You can add Borders to any Swing component. It is called a light weight component. A light weight component cannot exist by itself on the window desktop.
    JFrame, JDialog and JWindow are top level components. They can exist on their own on the windows desktop because essentially they are Windows native components. They have been fancied up to make it easy for you to access and add other Swing components to it which is why they are found in the swing package.
    A Windows border is not the same thing as a Swing Border and there is no way to access the native windows border and use it in a Swing application (that I know of anyway). Swing Borders are not used in a normal JFrame, the Windows border is used. You can however, turn off the use of Windows decorations and use Swing painted decorations. Read the tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html#setDefaultLookAndFeelDecorated]Specifying Windows Decorations. However, this doesn't really help you with your Border problem. If you look at the source code for the FrameBorder, you will find that the "blue" color of the Border is only painted for "active" windows and a JWindow can never be the active window, only the parent JFrame or JDialog is considered active.
    Here is a simple program for you to play around with:
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class FrameDecorated
         public static void main(String[] args)
              JFrame.setDefaultLookAndFeelDecorated(true);
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
              frame.setSize(300, 300);
              frame.setVisible(true);
              Border border = frame.getRootPane().getBorder();
    //          Border border = UIManager.getBorder( "RootPane.frameBorder" );
              System.out.println( border );
              JWindow window = new JWindow(frame);
              JPanel contentPane = (JPanel)window.getContentPane();
              contentPane.add(new JTextField(), BorderLayout.NORTH);
              contentPane.setBorder( border );
              window.setSize(300, 300);
              window.setLocationRelativeTo( null );
              window.setVisible( true );
              System.out.println("Window:" + window);
              Window ancestor = SwingUtilities.getWindowAncestor(contentPane);
              System.out.println("Ancestor:" + ancestor);
              System.out.println(ancestor.isActive());
              System.out.println(frame.isActive());
    }

  • Error in File ~tmp81c59e23760a10.rpt: Invalid argument for database

    When trying to run the report via Crystal Reports Server, we get the following error:
    Error in File ~tmp81c59e23760a10.rpt: Invalid argument for database.
    Opening the report in Crystal Reports 2008 and running a verify database, confirms that everything is working. Yet when we run it through Crystal Reports Server it errors every time.
    We are using a Progress ODBC driver which works fine when running reports via Crystal Reports 2008
    Can you please shed some light on this.
    I have already checked to see if there was a service pack or any other hot fixes available.

    Hi Brett,
    I believe I have the same error. ie
    Invalid Argument provided.
    Error in File xxxxx {C8F4D455-6B45-4859-B1B0-3E77619E5AD0}.rpt:
    Invalid argument for database."
    Have you managed to resolve the issue yet?
    We're running Crystal Reports 2008 Basic on MS SQL Server 2005.
    The Crystal Report works fine, when run on the server (and/or in terminal server session), but if it is run from a desktop client, which connects to the server, it gives the error above.
    So in my case, it must permissions or component related (ie something not loaded, that should be).
    I found the following on the internet:
    u201DIDataReader supports only one table by default
    When you view a report that has tables with the data source set to
    IDataReader for each one, and many of the tables are linked together, you
    may see the following error message: "Invalid database argument." Calls
    made to SetDataSource() from an IDataReader are supported only for
    reports that contain one table.
    Workaround
    To use an IDataReader with multiple tables, create a report with one
    command table that selects the necessary fields.u201C
    From researching in SAP BOBJ Notes I found somethings to try, or look at, but can't quite tackle them yet. I'll let you know how it goes.
    Best Regards,
    George

  • When i double click itunes it doesn't open it just comes up with an error saying " The itunes library.itl file cannot be found or created. The default location for this file is in the 'itunes' folder in the 'music' folder". How can i fix this?

    When i double click itunes it doesn't open it just comes up with an error saying " The itunes library.itl file cannot be found or created. The default location for this file is in the 'itunes' folder in the 'music' folder. How can i fix this problem?

    Anyone can help to advice how to solve this issue ?

  • How do you invoke the default browser for Unix/OSX

    Does anyone know how to programmatically display the contents of a URL in the default browser for a Unix system? I found a javaworld article on doing this using Runtime.getRuntime().exec(cmd). The article gives the cmd string for invoking the default browser in Windows, and for invoking the Netscape browser in Unix.
    This can easily be extended to invoke any known browser executable in a known path on a Unix system; but I'd like to invoke the default browser without knowing what or where it is. I'm specifically targetting Mac/OSX, but any Unix solution is worth trying.
    Is there a Unix command for launching the default browser to display the contents of a given URL? Or is there an alternative approach, rather than invoking Runtime.exec()?
    -Mark

    After extensive google searching, I came across a partial solution. This code detects the default browser on a Mac, and provides an elegant solution for trying standard browsers in turn for other Unix systems. I tested it on WIndows XP and Mac OSX 3.9, and it detected the default browser each time. A suped up version of this tool is available as a SourceForge project. You can find it here:
    http://sourceforge.net/projects/browserlaunch2/
    Here's the simplified code:
    //  Bare Bones Browser Launch                          //
    //  Version 1.5                                        //
    //  December 10, 2005                                  //
    //  Supports: Mac OS X, GNU/Linux, Unix, Windows XP    //
    //  Example Usage:                                     //
    //     String url = "http://www.centerkey.com/";       //
    //     BareBonesBrowserLaunch.openURL(url);            //
    //  Public Domain Software -- Free to Use as You Like  //
    import java.lang.reflect.Method;
    import javax.swing.JOptionPane;
    public class BareBonesBrowserLaunch {
       private static final String errMsg = "Error attempting to launch web browser";
       public static void openURL(String url) {
          String osName = System.getProperty("os.name");
          try {
             if (osName.startsWith("Mac OS")) {
                Class fileMgr = Class.forName("com.apple.eio.FileManager");
                Method openURL = fileMgr.getDeclaredMethod("openURL",
                   new Class[] {String.class});
                openURL.invoke(null, new Object[] {url});
             else if (osName.startsWith("Windows"))
                Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
             else { //assume Unix or Linux
                String[] browsers = {
                   "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" };
                String browser = null;
                for (int count = 0; count < browsers.length && browser == null; count++)
                   if (Runtime.getRuntime().exec(
                         new String[] {"which", browsers[count]}).waitFor() == 0)
                      browser = browsers[count];
                if (browser == null)
                   throw new Exception("Could not find web browser");
                else
                   Runtime.getRuntime().exec(new String[] {browser, url});
          catch (Exception e) {
             JOptionPane.showMessageDialog(null, errMsg + ":\n" + e.getLocalizedMessage());
       }

  • Why does itunes override default settings for windows 7?

    something is seriously wrong with my windows 7 / itunes interface. 
    when i click 'listen live' on kpfa (the ONLY station on which this happens), instead of going to my default setting for winamp, itunes jumps in and starts itself. 
    THIS IS NOT WHAT I WANT!  i have tried everything possible to make sure the defaults are correct, even going so far as to uninstall/re-install itunes to no avail.  *** is itunes up to?  when i want to use it, i will start it myself...and when and why did this change happen?  this computer belongs to ME, not apple, not itunes.  making changes to my computer without permission is ********.  why can't i fix this?
    angry in anchorage

    i already did that at the direction of:
    miguel guerrero
    web producer
    kpfa radio 94.1
    [email protected]
    nothing works.  i am righteously ****** off about this.  when and how did this change occur?  i have never had this problem before.

  • How to set a default value for a drop down list box and then apply cascading based on the default value in Infopath 2010.

    Hello Everyone
    I have two drop downs. Both are coming from look up fields from two lists. i want to set a default value(first list item) for the first drop down list box and then apply cascading based on the default value for the next drop down list box. I found one article(http://www.bizsupportonline.net/infopath2010/display-first-item-drop-down-list-box-infopath-2010.htm)
    where in i can set a default value but i can't apply cascading based on that default value. Any suggestions would be highly appreciated.
    Thanks
    Ramanjulu Naidu N

    Hey Ramanjulu,
    Take a look at the below article which I believe will answer your question.
    http://basquang.wordpress.com/2010/03/29/cascading-drop-down-list-in-sharepoint-2010-using-infopath-2010/
    Daniel Christian (MCTS)

  • When I try to open ITunes it brings up a box that says the iTunes Library. itl file cannot be found or created. the default location for this fie is in the itunes folder in the music folder How do I solve this

    My laptop was updating itunes and turned off and every since when i try to load itunes it brings up a window that says
    The itunes library.itl fie cannot be found or created. The default location for this fie is in the itunes folder in the Music folder.
    an I cant figure out what to do to get itunes to load so I can't use itunes at all which ***** since it also means I right now I can't add music to my ipod or apps or anything. So hopefully someone can tell me what happened and how to fix it or solve it

    Hi pgarard1,
    If you are having issues with launching iTunes after an update, you may want to take a look at the troubleshooting in the following article:
    iTunes for Windows: Doesn't open after upgrading in Windows Vista or Windows 7
    http://support.apple.com/kb/TS2363
    Regards,
    - Brenden

  • Default password for SID adm

    The subject says it all - I am new to MaxDB, and did not install the application.
    We are trying to update some tables, and get permission errors.
    I have the SUPERDBA user, but that user does not have permissions on the <SID>ADM tables.
    Is there a default password for the <SID>ADM database user?
    I am probably missing something very easy here.

    SAP customer - yes - I am reviewing the documentation - it leaves a lot to be desired
    Here is the output you requested:
    dbmcli on GRD>sql_execute select * from users
    OK
    END
    'CONTROL';'';'CONTROL';'ADMIN';'MULTIPLE';(null);(null);(null);'DEFAULT';'20090218';'00160032';'20090218';'00160032';'20090218';'00160032';'GRD';'grc-app-dev01';0;'NO';(null)
    'SUPERDBA';'';'SUPERDBA';'SYSDBA';'MULTIPLE';(null);(null);(null);'DEFAULT';'20090218';'00160032';'20090218';'00160033';'20090218';'00160032';'GRD';'grc-app-dev01';10;'NO';(null)
    'SUPERDBA';'';'SAPGRD';'DBA';'MULTIPLE';(null);(null);(null);'UNICODE';'20090218';'00160045';'20090218';'00160045';'20090218';'00160045';'GRD';'grc-app-dev01';28;'NO';(null)
    'SUPERDBA';'';'SAPGRDDB';'DBA';'MULTIPLE';(null);(null);(null);'UNICODE';'20090218';'00160052';'20090218';'00160052';'20090218';'00160052';'GRD';'grc-app-dev01';29;'NO';(null)
    I'm not 100% sure what you are looking for on the second query, all I could get to work was this -
    select * from tables
    which gives a lot of output, here is some:
    'SUPERDBA';'SUPERDBA';'ROOTS';'SEL+';'SYSTEM';'VIEW';'20090218';'00160033';(null);(null);(null);(null);(null);(null);(null);;x'00000000000000B1';(null);(null);(null);(null)
    'SUPERDBA';'SUPERDBA';'RUNNING_COMMANDS';'SEL+';'SYSTEM';'VIEW';'20090218';'00160033';(null);(null);(null);(null);(null);(null);(null);;x'00000000000000B2';(null);(null);(null);(null)
    'SUPERDBA';'SUPERDBA';'RUNNING_PARSEIDS';'SEL+';'SYSTEM';'VIEW';'20090218';'00160033';(null);(null);(null);(null);(null);(null);(null);;x'00000000000000B3';(null);(null);(null);(null)
    'SUPERDBA';'SUPERDBA';'SERVERDBSTATISTICS';'SEL+';'SYSTEM';'VIEW';'20090218';'00160033';(null);(null);(null);(null);(null);(null);(null);;x'00000000000000A1';(null);(null);(null);(null)

  • Default option for password in UME

    Hi,
    Is there a way that when we create new users in UME, that the default option for password management is set to "Disabled Password" in stead of "Define Initial Password".
    We are using SPML SOAP message to create the users and if there is no password in the SPML messgae, the user is created, but no logon is possible as the system expects that you should have a  password.
    We will like to avoid sending in the password as part of user creation process, as these users will have to be created with no password. These users will never do a basis authentication, but  are needed for SSO using HTTP header variable..
    Thanks,
    Vikrant sud

    Is this a portal or what?
    On the ABAP side this is possible, so I would expect the Java APIs to offer the same.
    Looking in the PASSWORD structure is the wrong place, try the LOGONDATA (if it is done the same way). If you activate it in the call it should delete the PASSWORD regardless.
    Sorry, I have an ABAP mentality... but consistent APIs make it easier (to have to understand less concepts) and SAP increasingly does this.
    Cheers,
    Julius
    Edited by: Julius Bussche on Nov 19, 2009 9:47 PM

  • How to change default thresholds for some metrics of all targets.

    Hi!
    We have a lot of servers which have to work hard.
    So, our OEM very often generates messages like these:
    "EM Alert: Critical:dbsora90.tsb.kz - CPU Utilization is 99.95%, crossed warning (80) or critical (95) threshold."
    "EM Alert: Critical:dbsora94.tsb.kz - Disk Device c8t60A9800043346C384C344A4A63516D6Ad0(ssd4) is 99.7% busy."
    "EM Alert: Critical:dbsora94.tsb.kz - CPU Load (Run Queue Length averaged over 5 minutes) is 20.78, crossed warning (10) or critical (20) threshold."
    I need to change default tresholds for mentioned metrics but I can't their defenition in SYSMAN.MGMT_*-tables or suitable settings in OEM GUI.
    And I have no time to edit treshholds manually for each target. )

    Modification of Metric Thresholds (as this is what you are referring to), should be done using the Metrics and Policy Settings link (to be found in the Target Home page).
    Don't mess around with the SYSMAN tables!
    Best thing to do here is to start using Monitoring Templates for this.
    Check:
    Oracle® Enterprise Manager Concepts
    11g Release 11.1.0.1
    http://download.oracle.com/docs/cd/E11857_01/em.111/e11982/toc.htm
    Regards
    Rob
    http://oemgc.wordpress.com

Maybe you are looking for

  • Installing Solaris 9 on HP ML350 G5 server - No disks found

    Some weeks ago I've post a topic about problem with installing Solaris 10 on HP ML350 G5 server. ( [http://forum.java.sun.com/thread.jspa?threadID=5308827] ) OK, it have been solved. Thanks! But now I need to install Solaris 9 on this server. The pro

  • IDOC Acknowledgement with ALEAUD01 does not work

    Hi, since my last thread Changing IDOC status after succesful processing i learned much about IDoc's and ALE. But my problem is still alive! I have the scenario IDOC (HRMD_A06) --> XI --> file. I noticed that the file adapter creates an acknowledge m

  • Need to understand Site Assignment and Content Location Boundary Groups

    Okay I am very confused about something that I am seeing that is throwing my understanding of how Boundary Groups work completely off.  Here is my dilemma: I created two boundary groups, a site assignment and a content location boundary group. The si

  • Error 0xE8004006

    I have a new Ipad 2 since 2 weeks and during the syncing process between Itunes and my Ipad  importing new Ipad software the Ipad is no longer recognized by Itunes and the message Error 0xE8004006 appeared.  I tried to use the latest reservecopy from

  • Java & ABAP

    Hi, Can anybody tell me the advantages of java over abap and also the differnces between abap and java.