| 05-20-2003, 06:15 PM | #1 |
Guest | not sure where people look for stuff so here is the link to the a post about a osx spell editor-ish program and an applescript for mpq2k http://www.wc3campaigns.com/forums/s...threadid=17494 |
| 05-20-2003, 06:25 PM | #2 |
Good job. It's good to see that people try to "restore" the damage of the server problems. |
| 06-08-2003, 04:55 PM | #3 |
Guest | below is an updated version of the script, it runs much better now. directions: 1) open map in mpq2k 2) start up my script (below) 3) choose the folder --this is for mpq2k 4) choose the folder in the dialog that pops up --this is for the script Notes: -click "okay" button NOT the "select" button on the other dialog -it ONLY adds files with .txt and .slk extensions -you still need gui scripting addtion from apple for this to work (available for free from the apple website) ------- COPY AND PASTE ALL THE BELOW INTO APPLESCRIPT EDITOR----------- --while i can't think of a way anything bad could happen by running this script to use it you must acknowledge that the maker is NOT liable for any problems/damages that may or may not be caused by the script. set theFolder to choose folder with prompt "choose a folder" tell application "Finder" set fileNames to the name of every file of theFolder as list end tell set fileCount to count fileNames set loopCount to 0 set alright to false repeat set alrighty to false if loopCount = fileCount then exit repeat set loopCount to loopCount + 1 if item loopCount of fileNames contains ".txt" then set alrighty to true if item loopCount of fileNames contains ".slk" then set alrighty to true if alrighty is true then set theAddCommand to {"a ", "Units\\", item loopCount of fileNames as text, " /c"} as text tell application "System Events" tell process "MPQ2K" set frontmost to true tell UI element 2 keystroke theAddCommand keystroke return end tell if loopCount = 1 then activate display dialog "pick the folder to get the files from" end if set frontmost to true tell UI element 2 if loopCount is not equal to 1 then keystroke " " keystroke (ASCII character 29) delay 1 if loopCount is greater than 1 then set subLoop to 0 repeat set subLoop to subLoop + 1 if subLoop = loopCount then exit repeat keystroke (ASCII character 31) delay 0.5 end repeat end if keystroke return delay 0.5 end tell end tell end tell end if end repeat activate display dialog "Done" buttons {"Thanks"} default button 1 |
