Announcement

Collapse
No announcement yet.

Please Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Please Help

    How can i make my software when it opened by a file extension (ex, File.klk) it do a custom action like start the program but with custom action only when i open the program by a custom file extension???

  • #2
    I am sorry my friend but your 3 posts are "HELP ME" with no code, no examples, how are people to understand what you are trying to achieve.
    Example:
    it do a custom action
    Please give people a break

    Comment


    • #3
      Originally posted by charliechaps View Post
      I am sorry my friend but your 3 posts are "HELP ME" with no code, no examples, how are people to understand what you are trying to achieve.
      Example:

      Please give people a break
      Alright sry mb
      like when you click on .apz file, the apz file is being opened by (Autoplay media studio) but with the file data (it opens the project don't open the program "ams")
      so consider that i made a file extension called .klk , then i changed the way how it starts (when you click on it), it opens my program but (example, file called "File.klk" when i clicked on it two times to open it, it opened my program but the interior data on the file(example, the file contains some random words "lol xd haha") so when i click on the file two times and it opens my program it loads "lol xd haha" on an input object in my program) so how do i do that?
      and sorry again

      Comment


      • #4
        Ok I'm not sure what you are after, if you rename a file that is an EXE
        Windows cannot know how to open the file, but if you rename a text file, then AMS can read and open such a file
        but you still have to let Windows know to open with notepad.So on another computer you have to rename it back to .txt file to view it
        I am not sure if this helps you : mytest.apz

        Comment


        • #5
          Originally posted by charliechaps View Post
          Ok I'm not sure what you are after, if you rename a file that is an EXE
          Windows cannot know how to open the file, but if you rename a text file, then AMS can read and open such a file
          but you still have to let Windows know to open with notepad.So on another computer you have to rename it back to .txt file to view it
          I am not sure if this helps you : [ATTACH]n302213[/ATTACH]
          I mean like
          (notice: this script means nuthin but will make u get the idea also happy new year)
          Code:
          if Application opened by file extension (.klk)
          then get the text of the file and put it in an input

          Comment


          • #6
            Yes Happy 2019
            I showed you how to read text from a file (must be a text file) into object but
            if Application opened by file extension (.klk)
            I am still unsure what you mean - double clicking on a file with extension .klk means nothing to windows
            Do you mean something like this

            Code:
            -- tbSearchFiles = {"*.doc", "*.ppt", "*.odt", "*.exe"}; set your own file types here
                -- this one search all types
                tbSearchFiles = {"*.*"};
            
                for index,type in pairs(tbSearchFiles) do
                   file = File.Find(folder, type, false, false, nil);
                   
                       if file ~= nil and file ~="CANCEL" then
                    
                          --do the following for each file:
                          for j,file_path in pairs(file) do
                                 --add the item to the listbox, with the name visible and path as data
                                 tbFilePath = String.SplitPath(file_path);
                                 sFile = tbFilePath.Extension;--Gets only File extensions from table
                             [COLOR=#FF0000] if sFile == ".klk" then--This is the extension we want[/COLOR]
                                 Do something here
                              end                          
                          end
                       end
                end

            Comment


            • #7
              Originally posted by charliechaps View Post
              Yes Happy 2019
              I showed you how to read text from a file (must be a text file) into object but

              I am still unsure what you mean - double clicking on a file with extension .klk means nothing to windows
              Do you mean something like this

              Code:
              -- tbSearchFiles = {"*.doc", "*.ppt", "*.odt", "*.exe"}; set your own file types here
              -- this one search all types
              tbSearchFiles = {"*.*"};
              
              for index,type in pairs(tbSearchFiles) do
              file = File.Find(folder, type, false, false, nil);
              
              if file ~= nil and file ~="CANCEL" then
              
              --do the following for each file:
              for j,file_path in pairs(file) do
              --add the item to the listbox, with the name visible and path as data
              tbFilePath = String.SplitPath(file_path);
              sFile = tbFilePath.Extension;--Gets only File extensions from table
              [COLOR=#FF0000] if sFile == ".klk" then--This is the extension we want[/COLOR]
              Do something here
              end
              end
              end
              end
              thank you so much i really appreciated

              Comment


              • #8
                but i am sorry just one more question
                So u got the image here, when i open the unknown extension (.lpl) it opens the program, but i need when it opens the program it reads the data inside the file that got unknown extension (ex. file.lpl), so i need it opens then reads the data inside the file and put it on an input (or scintilla plugin), for now it opens the program only
                Click image for larger version

Name:	1.PNG
Views:	129
Size:	207.6 KB
ID:	302230

                Comment


                • #9
                  do you mean that you want to associate *.klk file to your project, and when double click on it you want the project to make specific action (Not the normal startup action). ?

                  Comment


                  • #10
                    Originally posted by bils View Post
                    do you mean that you want to associate *.klk file to your project, and when double click on it you want the project to make specific action (Not the normal startup action). ?
                    Yeah ♥♥ finally someone got me xD

                    Comment


                    • #11
                      https://www.indigorose.com/webhelp/a...sociations.htm

                      You need to modify the registry for that and add an entry for your file extension. Generally, this is not advised to be doing from your application - however you should do that from the installer of your application. Aside from that, look at the HKEY_CLASSES_ROOT in your registry (regedit) and see how other software does it.
                      Bas Groothedde
                      Imagine Programming :: Blog

                      AMS8 Plugins
                      IMXLH Compiler

                      Comment


                      • #12
                        Originally posted by Imagine Programming View Post
                        https://www.indigorose.com/webhelp/a...sociations.htm

                        You need to modify the registry for that and add an entry for your file extension. Generally, this is not advised to be doing from your application - however you should do that from the installer of your application. Aside from that, look at the HKEY_CLASSES_ROOT in your registry (regedit) and see how other software does it.
                        Alright how do i code the registery to read the file data then write it into an input (or scintilla plugin)
                        btw i miss u dude i am itz magdy if u remember

                        Comment


                        • #13
                          Originally posted by Tanner View Post

                          Alright how do i code the registery to read the file data then write it into an input (or scintilla plugin)
                          btw i miss u dude i am itz magdy if u remember
                          You could read the manual regarding the Registry functions:
                          https://www.indigorose.com/webhelp/a...t.htm#Registry
                          Bas Groothedde
                          Imagine Programming :: Blog

                          AMS8 Plugins
                          IMXLH Compiler

                          Comment


                          • #14
                            Hello again my friend,
                            After searching the forums I found what you were talking about
                            Is this what U R after, sorry exceeds the 8.5Mb by 34k
                            Link: https://*******/#!PHY0FC5a!cG7xFrhYv...kamwM6Zw6aCIbc

                            Comment


                            • #15
                              Update
                              Click image for larger version

Name:	mytest.png
Views:	57
Size:	30.6 KB
ID:	302242
                              Click image for larger version

Name:	File.png
Views:	60
Size:	40.0 KB
ID:	302243
                              Click image for larger version

Name:	myapp.png
Views:	61
Size:	24.7 KB
ID:	302244
                              File1 in first pic should read lpk - Install installs myapp and Unassociate does what it says

                              Comment

                              Working...
                              X