Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More import/export tweaking

  • Loading branch information...
commit 0fd83043259294f840e7ddcad33ecb901980e6b6 1 parent ca9a5bd
adam authored
Showing with 24 additions and 4 deletions.
  1. +24 −4 texter.ahk
28 texter.ahk
View
@@ -915,11 +915,13 @@ IfMsgBox, Yes
Loop,%BundleDir%replacements\*,0
{
FileRead,replacement,%A_LoopFileFullPath%
+ IfInString,replacement,`r`n
+ StringReplace,replacement,replacement,`r`n,`%bundlebreak,All
IniWrite,%A_LoopFileName%,Texter Exports\%CurrentBundle%.texter,%A_Index%,Hotstring
IniWrite,%replacement%,Texter Exports\%CurrentBundle%.texter,%A_Index%,Replacement
}
}
-MsgBox,4,Your bundle was successfully created!,Congratulations, your bundle was successfully exported!`nYou can now share your bundle with the world through Texter's import feature. `n`nWould you like to see the %CurrentBundle% bundle?
+MsgBox,4,Your bundle was successfully created!,Congratulations, your bundle was successfully exported!`nYou can now share your bundle with the world by sending them the %CurrentBundle%.texter file.`nThey can add it to Texter through the import feature. `n`nWould you like to see the %CurrentBundle% bundle?
IfMsgBox, Yes
Run,Texter Exports\
return
@@ -929,21 +931,33 @@ FileSelectFile, ImportBundle,,, Import Texter bundle, *.texter
if ErrorLevel = 0
{
IniRead,BundleName,%ImportBundle%,Info,Name
+ IfExist bundles\%BundleName%
+ {
+ MsgBox,4,%BundleName% bundle already installed,%BundleName% bundle already installed.`nWould you like to overwrite previous %BundleName% bundle?
+ IfMsgBox, No
+ return
+ else
+ {
+ FileRemoveDir,bundles\%BundleName%,1
+ }
+ }
FileCreateDir,bundles\%BundleName%
FileCreateDir,bundles\%BundleName%\replacements
FileCreateDir,bundles\%BundleName%\bank
+
Loop
{
IniRead,file,%ImportBundle%,%A_Index%,Hotstring
IniRead,replacement,%ImportBundle%,%A_Index%,Replacement
StringReplace, hotstring, file, .txt
+ StringReplace,replacement,replacement,`%bundlebreak,`r`n,All
bundleCollection = %hotstring%,%bundleCollection%
if file = ERROR
break
else
FileAppend,%replacement%,bundles\%BundleName%\replacements\%file%
}
- Gui, 8: Add, Text, Section x10 y10,What triggers would you like to use with this bundle?
+ Gui, 8: Add, Text, Section x10 y10,What triggers would you like to use with the %BundleName% bundle?
Gui,8: Add, Checkbox, vEnterCbox x30, Enter
Gui,8: Add, Checkbox, vTabCbox yp xp+65, Tab
Gui,8: Add, Checkbox, vSpaceCbox yp xp+60, Space
@@ -963,8 +977,14 @@ if TabCbox = 1
FileAppend,%bundleCollection%,bundles\%BundleName%\bank\tab.csv
if SpaceCbox = 1
FileAppend,%bundleCollection%,bundles\%BundleName%\bank\space.csv
-IniWrite,1,texter.ini,Bundles,%BundleName%
-Gosub,BuildActive
+MsgBox,4,Enable %BundleName% bundle?,Would you like to enable the %BundleName% bundle?
+IfMsgBox,Yes
+{
+ IniWrite,1,texter.ini,Bundles,%BundleName%
+ Gosub,BuildActive
+}
+else
+ IniWrite,0,texter.ini,Bundles,%BundleName%
return
;; method written by Dustin Luck for writing to ini
Please sign in to comment.
Something went wrong with that request. Please try again.