Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16

Thread: Is It Possible?

  1. #1
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629

    Lightbulb Is It Possible?

    hey
    its me again

    if (for example) you make an app. with a media player plugin in it and build the program eventually. Could you right-click a song, select "Open With" then choose the app. i built? is this possible with ams6?

    hope that makes sense

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    yes, but you will need to process the commandline within your app. Someone correct me if I'm wrong, but the OS will fire the associated application with the file as a command line parameter. AMS allows you to accept commandlines parameters, so this is definitely doable.

  3. #3
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629

    Post

    glad its doable.. but "how" is the problem!
    if anybody can help me id greatly appreciate it..

  4. #4
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    You didn't ask that...

    Look in the help file for Commandline, you'll find info there for how to deal with them. If you have trouble after that, post some code, and someone here will more than likely help get you going in the right direction.

  5. #5
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    thnx for the tip but the AMS help file only shows you command line arguments and command line variables..
    Last edited by Mina; 11-02-2005 at 02:21 AM.

  6. #6
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    maybe it has something to do with the Global functions?

  7. #7
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Code:
    if _CommandLineArgs[1] ~= "" then
    	--open the file
    	sFileName = _CommandLineArgs[1];
    	--do whatever you need to here
    else
    	--no file was passed to the app
    end

  8. #8
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    I see that Worm has posted, the story of my life, day late and a dollar short . . . is that violins that I hear. . . That reminds me of a funny story. My kids told our neighbors that they were not able to watch a certain movie because of the violins. Are we raising our kids to be prejudice against violins? NO, but we don't let them watch VIOLENT movies either.

    Anywho, here was my stab at the code, I have also added the command line stuff to a project if you want to see how it works.

    Code:
    if _CommandLineArgs[1] then
    	if File.DoesExist(_CommandLineArgs[1]) then
    		strInput = _CommandLineArgs[1];
    	else
    		Dialog.Message("ERROR", "There was an error in loading the file.");
    		strInput = Application.LoadValue("IR Product CodeViewer\\Settings", "LastFileViewed");
    	end
    else
    	strInput = Application.LoadValue("IR Product CodeViewer\\Settings", "LastFileViewed");
    end
    The above code was used for the IR Project CodeViewer.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  9. #9
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    appreciate ur help
    thnx

  10. #10
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    to try it i used

    result = Application.GetMenu();
    Paragraph.SetText("Paragraph1", result);

    but it gives an error: it must be a type of string
    what should i do about that?

    mina

  11. #11
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Mina, you should really utilize the help guide. Would save you so much posting time, grief, waiting.

    Just use the string variables below (sMessage) and apply it to your paragraph object -

    Code:
    function OutputMenu (tMenuToOutput, nLevelCount, sMenuString)
      -- Since we don't want to make nLevelCount required (for the first call),
      -- we have to initialize it if it is not passed to the function
      if not nLevelCount then
         nLevelCount = 0;
      end
    
      -- sMenuString is not a required variable (for the first call),
      -- therefore we must initialize it if it was not passed to the function.
      if not sMenuString then
         sMenuString = "";
      end
    
      -- Menu table is numerically indexed, step through for each node
      for nIndex, tMenuItem in tMenuToOutput do
         -- Add the current menu item to the string to return, whether it has a sub menu or not
         sMenuString = sMenuString .. String.Repeat(" ", nLevelCount*4) .. tMenuItem.Text .. " (ID: " .. tMenuItem.ID .. ")".. "\r\n";
         -- Check if a sub menu exists at the current menu's location
         if type(tMenuItem.SubMenu) == 'table' and tMenuItem.ID == -1 then
            -- A sub menu exists.  Recursively call this function to include the sub menu.
            -- Increasing the level count by 1 controls the indent that the item will have in the output.
            sMenuString = OutputMenu (tMenuItem.SubMenu, nLevelCount + 1, sMenuString);
         end
      end
    
      -- Return the menu string
      return sMenuString;
    end
    
    -- Get the menu structure and store in a table
    tMenu = Application.GetMenu();
    
    -- Set the title and message for the Dialog.Message box
    sTitle = "Current Menu Structure";
    sMessage = OutputMenu(tMenu);
    
    -- Display a Dialog.Message box to the user
    Dialog.Message(sTitle, sMessage);

  12. #12
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Application.GetMenu returns a table, you need to use the table elemtents

    result.ID --(number)
    result.Text --(string)
    result.Enabled --(boolean)
    result.Checked --(boolean)
    result.SubMenu --(table)


    Quote Originally Posted by Mina
    to try it i used

    result = Application.GetMenu();
    Paragraph.SetText("Paragraph1", result);

    but it gives an error: it must be a type of string
    what should i do about that?

    mina

  13. #13
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    I agree with Tigg, peaceful non-violins is the only way to go.

    That's the first time I've heard of anyone limiting their childrens' media intake toward that end though. Commendable stuff Tigg, that's some mighty fine parenting. You guys never fail to impress me. Your tykes have got it made in the shade with pink lemonade.

  14. #14
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    feel so much like a beginner here..
    thnx for all the help

  15. #15
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    You'll be surprised how quickly you can get some decent traction with AMS. The basics are pretty straightforward and once you have those the rest is gravy.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts