How to update an IDEA ".ise" Script

2 posts / 0 new
Last post
emad.alphonse@i...
Offline
Joined: 10/01/2020 - 13:43
How to update an IDEA ".ise" Script

Hello,
I am not a programer, but I use IDEA quite a lot at my work. I have a very useful IDEA script that I use to import multible Excel Files in the same folder, with the same file layout inot IDEA.
the Script has an extension of .ise, which dosn't enable me to open it. I am only able to Run it from the macros menu in IDEA.
 
I like to be abe to open this script in IDEA, so I can understand how it works, and may be make some changes to it, to be able to do more.
 
how can I do that?
 
I will appreciate any help on this. you can email me at: emad.alphonse@irs.gov

klmi
Offline
Joined: 02/13/2019 - 08:41

It's not possible to decompile a *.ise file (details about the filetypes please see here: https://www.ideascripting.com/forum/difference-between-iss-ise-and-exe-file). You can try to create a new script which is no rocket science when I read what your script should do.
1. Start with the Dir example from the language browser.
2. Manually import a Excel file and take the macro code from the history.
 
3. Put the things together:
 
Sub Main
   DIRECTORY = "D:\IDEA Projects\Samples\Sourcefiles.ILB\"
   EXTENSION = "*.XLSX"
   files = Dir(DIRECTORY & "" & EXTENSION)
   Do While files <> ""
      If Len(files) > 1 Then
         Set task = Client.GetImportTask("ImportExcel")
         dbName = DIRECTORY & files
         task.FileToImport = dbName
         task.SheetToImport = "Sheet1"
         task.OutputFilePrefix = "Import_"
         task.FirstRowIsFieldName = "TRUE"
         task.EmptyNumericFieldAsZero = "TRUE"
         task.PerformTask
         dbName = task.OutputFilePath("Sheet1")
      End If
      files = Dir
   Loop
   Set task = Nothing
End Sub