home *** CD-ROM | disk | FTP | other *** search
/ PSION CD 2 / PsionCDVol2.iso / Programs / 406 / ESCRIPT1.SIS / EScript.SIS / EScript.hlp (.txt) next >
Encoding:
EPOC Database  |  1998-11-03  |  53.5 KB  |  662 lines

  1. "DATA.app
  2. Table1
  3. ColA10
  4. ColB10
  5. ColA15
  6. ColB15
  7. ColA16
  8. ColB16
  9. ColA64
  10. ColB64
  11. ColA65
  12. ColB65
  13. ColA66
  14. ColB66
  15. ColA67
  16. Index1
  17. ColA67
  18. ColA66P
  19. ColA16
  20. Tutorial: Macro settings
  21. Macro tips
  22. EsRunMacro
  23. ESClipText
  24. ESCursorRight
  25. EsSendCommand
  26. ESTypeText
  27. ESSwitchtoCalc
  28. EsSwitchtoCurrentApp
  29. ESSwitchtoData
  30. ESSwitchtoEmail
  31. ESSwitchtoSheet
  32. ColB16
  33. ColA64
  34. ColB64
  35. ColA65
  36. ColB65
  37. ColA66
  38. ColB66
  39. ColA67
  40. Index1
  41. ColA67
  42. ColA66P
  43. ColA16
  44. ESSwitchtoSketch
  45. EsSwitchtoSystem
  46. ESSwitchtoWeb
  47. ESSwitchtoWord
  48. ESTypeText
  49. ESCopy$
  50. EsCopytoClip
  51. ESCursorDown
  52. ESCursorLeft
  53. ESCursorRight
  54. ESPasteText
  55. EsPenClick
  56. EsPenDown
  57. EsPenMove
  58. ESSaveSetting
  59. AInserts the string Text$ into the application or document that has the focus, character by character. This is slower that EsPasteText but can be used in dialogs where you want to paste single characters or have to input a time field that woul not accept a complete string.
  60. ESIsCurrentAPP
  61. ESLoadSetting
  62. EsMacroApptoBack
  63. EsMacroApptoFront
  64. back,prior
  65. EsMenuKey
  66. AThis is a single command that copies the selected text to the clipboard and returns it as a string.
  67. This is useful when you want to do string manipuation in a macro without copying first.
  68. Example:-
  69. PROC macUpper:
  70.   EsSwitchtoCurrent:
  71.   EsPasteText$:(UPPER$(BLCopy$:))
  72. OAInserts the string Text$ into the application/document that has focus by copying it first to the clipboard. This makes it appear much faster than the EsTypeText command which inserts each character at a time. However, you can't use this command to insert dates/times into dialogs. EsTypetext is best used for that type of application.
  73. BSends a key command to the current application. The key$ is broken into a modifer and a command key.
  74. Modifiers allowed are FN, SHIFT,CTRL or any combination of the three, seperated with "+" signs.
  75. Key commands can be any alphanumeric character, or UP,DOWN,LEFT,RIGHT for cursor keys, ENTER, TAB,SPACE,ESC,DEL,MENU for other special keys. eg:-
  76.     EsSendCommand:("CTRL+C")
  77.     EsSendCommand:("CTRL+SHIFT+C")
  78.     EsSendCommand:("CTRL+ENTER")
  79.     EsSendCommand:("MENU")
  80.     EsSendCommand:("FN+RIGHT")
  81. Any commands that are not recognised will be reported when you run the Macro for the first time.
  82. Note: EsEnterKey,EsMenuKey and EsESCKey are all shortcut commands to the ENTER,MENU and ESC commands available with SendCommand
  83. Courier
  84. Courier
  85. Courier
  86. Courier
  87. ESSwitchtoAgenda
  88. ESSwitchtoSheet
  89. ESTypeText
  90. EbAddExtrabar
  91. ESDebugON:
  92. ESForeground
  93. EsMenuKey
  94. ESSaveSetting
  95. EbAddExtrabar
  96. EbShowExtraBar
  97. ESSelectCurrentWord
  98. Select,Wor
  99. ESSelectNextWord
  100. ESSelectCurrentWord
  101. Select,Wor
  102. ESSelectNextWord
  103. ESSelectCurrentWord
  104. Select,Wor
  105. ESSelectNextWord
  106. ESSelectCurrentWord
  107. Select,Wor
  108. ESSelectNextWord
  109. ESSelectCurrentWord
  110. Select,Wor
  111. ESSelectNextWord
  112. ESSelectCurrentWord
  113. Select,Wor
  114. ESSelectNextWord
  115. ESSelectCurrentWord
  116. Select,Wor
  117. ESSelectNextWord
  118. ESSelectCurrentWord
  119. Select,Wor
  120. ESSelectNextWord
  121. ESSelectCurrentWord
  122. Select,Wor
  123. ESSelectNextWord
  124. ESSelectCurrentWord
  125. Select,Wor
  126. ESSelectNextWord
  127. ESSelectCurrentWord
  128. Select,Wor
  129. ESSelectNextWord
  130. ESSelectCurrentWord
  131. Select,Wor
  132. ESSelectNextWord
  133. APauses execution of the macro until the user presses the ENTER
  134. key. 
  135. This is a useful command when you need to display a dialog (like the battery dialog in macBattCheck.opo) with a hotkey, and then find out when or if the user pressed ENTER to close the dialog.
  136. Note: Execution will not continue until the user presses the OK key. The calling application appears to hang if the user attempts to switch back to it. Pressing RETURN at any time continues execution of the macro.
  137. EsShowTasklist
  138. EsSwitchto / EsBgSwitchto
  139. ESSwitchtoAgenda
  140. ESSwitchtoApp / ESbgSwitchtoApp
  141. ESSelectCurrentWord
  142. Select,Wor
  143. ESSelectLastWord
  144. Select,Wor
  145. ESSelectLine
  146. ESSelectNextWord
  147. EsSendCommand
  148. xAReturns a string (up to 255 characters in length) containing the current clipboard text. This can be used in combination with the CTRL+C Keycommand, to access the clipboard. It is useful to add an element of authentication to make sure for example that the user has hilighted some text, or is on an Agenda entry (Agenda entries are contained as text in the Cliptext$ string).
  149. EsEnterKey
  150. EsESCKey
  151. ESForeground
  152. ESCursorUp
  153. EsDebugOFF
  154. ESDebugON:
  155. EsESCKey
  156. ESForeground
  157. 5AReturns a string variable containing a setting stored under the name SettingName$ within the EPOC Script settings file store in c:\system\data\ESSettings.ini. All settings are stored as strings so conversion is required for integers and other number based formats, eg:-
  158. TurnOn%=val(EsLoadSetting$:("TurnON"))
  159. AReturns a true or false  (-1 or 0) to indicate if the application specified as appname$ is currently in the foreground. Use this when you have application specific Macros that should not be run from any other app/document.
  160. Example:-
  161. If EsIsCurrentApp%:("Agenda")
  162.    Do stuff here
  163. ENDIF
  164. xBSends the Macro application to the background of the currently running tasks eg:-
  165. PROC macHelloWorld:
  166.     EsMacroApptoFront:
  167.     GIPRINT "Hello World"
  168.     EsMacroApptoBack:
  169. Note There may be occassions where additional commands are required before bringing the application to the foreground. For example, the macro application might have a user interface that you do not want to show when running your macro. ExtraBars hides it's interface automatically when launching macros but Backlite+Plus does not. Additional Escript commands are provided by applications like Backlite+Plus in this situation (ie BLHideBacklite/BLUnHideBacklite)
  170. c=Restores the windows hidden with the BLHideBacklite command.
  171. BLHideBacklite
  172. BLUnhideBacklite:
  173. BLUnhideBacklite0
  174. Courier
  175. Courier
  176. Courier
  177. cHSwitches the focus of macro commands to Sheet, loading it if necessary.
  178. EsSwitchtoSheet:
  179. EsSwitchtoSheetd
  180. c.Switches the focus of macro commands to Calc.
  181. EsSwitchtoCalc:
  182. EsSwitchtoCalcd
  183. Switches the focus of macro commands to Sketch, loading it if necessary.
  184. Note: The "real" name for the Psion Sketch application is "Paint". If you use the Switchto:(name$, use must specify the application name as "Paint"
  185. EsSwitchtoSketch:
  186. EsSwitchtoSketchd
  187. Switches the focus of macro commands to Email.
  188. Note: The "real" name for the Psion Email application is "Message". If you use the Switchto:(name$, use must specify the application name as "Message"
  189. EsSwitchtoEmail:
  190. EsSwitchtoEmaild
  191. Switches the focus of macro commands to Browser.
  192. Note: The "real" name for the Psion web application is "Browser". If you use the Switchto:(name$, use must specify the application name as "Browser"
  193. EsSwitchtoWeb:
  194. EsSwitchtoWebd
  195. c>Displays the current tasklist of open documents/applications.
  196. EsShowTasklist:
  197. EsShowTasklistd
  198. EsPasteText
  199. EsTypeText:(Text$)
  200. EsTypeTextd
  201.     ESClickOK
  202. EsWaitforEnter:
  203. EsWaitforEnterd
  204. cRWaits for a the number of seconds specified in secs% before continuing execution.
  205. EsWaitforSecs:(secs%)
  206. EsWaitforSecsd
  207. Courier
  208. Courier
  209. EsCopy$:
  210. EsCopy$d
  211. Courier
  212. Courier
  213. Courier
  214. Courier
  215. Arial
  216. Arial
  217. Arial
  218. Arial
  219. yBBrings the Macro application to the foreground of the currently running tasks eg:-
  220. PROC macHelloWorld:
  221.     EsMacroApptoFront:
  222.     GIPRINT "Hello World"
  223.     EsMacroApptoBack:
  224. Note There may be occassions where additional commands are required before bringing the application to the foreground. For example, the macro application might have a user interface that you do not want to show when running your macro. ExtraBars hides it's interface automatically when launching macros but Backlite+Plus does not. Additional Escript commands are provided by applications like Backlite+Plus in this situation (ie BLHideBacklite/BLUnHideBacklite)
  225. Courier
  226. Courier
  227. Courier
  228. Courier
  229. Courier
  230. Courier
  231. Courier
  232. Courier
  233. Arial
  234. Arial
  235. Arial
  236. Arial
  237. _BThis command allows you to save a setting to the EScript settings file. INI file settings are stored as strings, so the value should be converted using the OPL Num$ command first.
  238. The location of the EScript settings file is fixed as c:\system\data\ESSettings.ini. This allows other EScript applications to access the settings stored in this file.
  239. Settings example:-
  240. To save a string use EsSaveSetting:("UserName","John Smith")
  241. To save a number use EsSaveSetting:("HideWin",num$(Hidewin%,1))
  242. The num$ command has two parameters, a number variable to convert, and a length of characters to convert it to.
  243. ASwitches the macro debug mode on. With this mode switched on, you can step through your macro while it is playing to test the macro. Whilst playing, you are shown the next command and you can ESC out of the macro, Skip the next command or continue normally.
  244. This mode is ideal for testing complex macros before runnng them fully. Sometimes macros can have unpredicted results so it's always best to test the macro first.
  245. Adding macros to your own applications
  246. Macro tips
  247. EsAutoCloseON
  248. EsAutoCloseON
  249. EsAutoCloseON
  250. Welcome
  251. Using EScript
  252. Tutorial: Writing Macros
  253. Tutorial: Macro settings
  254. Tutorial: Macro settings
  255. CSwitches the focus of macro commands to the application or document specified as name$.
  256. name$ can be a caption name, ie "Agenda", a file path to an app file, or a document in which case Escript will locate and launch the appropriate application. 
  257. If EsSwitchtoApp is used, the app/doc is brought to the foreground. If EsBgSwitchtoApp is used, the app/doc is kept or sent to the background. 
  258. If the application is running, then focus is switched to the first running instance of the application. If the target application is not running, it is opened with the last file used.
  259. Examples:-
  260. EsSwitchto:("Word") 
  261. EsBgSwitchto:("c:\Jotter") 
  262. EsSwitchto:("c:\system\apps\Psizip\Psizip.APP") 
  263. In addition to this command, you can use the in-built shortcuts to access the main Series 5 applications:-
  264. Es(Bg)SwitchtoSystem:, Es(Bg)SwitchtoAgenda:, Es(Bg)SwitchtoData:, Es(Bg)SwitchtoSheet:, Es(Bg)SwitchtoRecord:, Es(Bg)SwitchtoWeb:, Es(Bg)SwitchtoEmail:, Es(Bg)SwitchtoSketch:,Es(Bg)SwitchtoCalc:
  265. Arial
  266. Arial
  267. Courier
  268. Arial
  269. Arial
  270. Arial
  271. Arial
  272. Arial
  273. Arial
  274. EsRunMacroSettings
  275. EsAskforTimeInput
  276. ESBackground
  277. background
  278. EsClearClip
  279. ESClipText
  280. EsLink
  281. EsAutoCloseOFF
  282. EsAutoCloseON
  283. EsRunMacro
  284. EsAskforTimeInput
  285. _AHalts execution of any futher Macro commands until the current application or document that has the focus has been exited.
  286. Example:-
  287. EsSwitchto:("Help.dbf")
  288. EsWaitforClose:("Waiting for exit..")
  289. This is used in the Shortcut macro within the macShortcutSettings procedure to wait for the user to edit and exit the shortcut database, before continuing.
  290. >c:\Help-017Temp
  291. Table1C
  292. .Description
  293. 2Program name
  294. "Keywords
  295. "See Also
  296. Usage
  297. Title
  298. Order
  299. cADisplays the menu of the application or document that has focus.
  300. EsSwitchto
  301. EsMenuKey:    EsMenuKeyd
  302. Displays a dialog asking for a time. Returns a string in the format: "HHMMSS". This string can then be "typed" into a dialog with EsTypeText:
  303. EsTypeText#EsAskforTimeInput$:(Title$,Prompt$)
  304. EsAskforTimeInputd
  305. c^Sends the document/application that currently has focus to the background of all other tasks.
  306. %background,foreground,order,priority
  307. EsForeground
  308. EsBackground:
  309. EsBackgroundd
  310. back,priority,order,backlite
  311. EsMacroApptoBack
  312. EsMacroApptoFront:
  313. EsMacroApptoFrontd
  314. ESBacklitetoFront
  315. EsMacroApptoBack:
  316. EsMacroApptoBackd
  317. This command sends an ESC keypress to the application/document that has the focus. Use it to press a Cancel button on a dialog, or to send an ESCAPE character (27)
  318. EsEnterKey
  319. EsESCKey
  320. EsESCKeyd
  321. This command sends an ENTER keypress to the application/document that has the focus. Use it to press on OK button on a dialog, or to send an carriage return code (13).
  322. EsESCKey
  323. ESEnterKey:
  324. EsEnterKeyd
  325. EsCopytoClip,EsCopy$
  326. EsClipText$
  327. EsClipTextd
  328. c5Copies the text specified in text$ to the clipboard.
  329. EsClipText, EsCopy$
  330. EsCopytoClip:(text$)
  331. EsCopytoClipd
  332. Sends a cursor down command to the application/document that has focus n% number of times. EsCursorDown:(1) sends one keypress, and increasing n% will send multiple keypresses in a single command.
  333. $EsCursorUp,ECursorLeft,EsCursorRight
  334. EsCursorDown:(n%)
  335. EsCursorDownd
  336. Sends a cursor left command to the application/document that has focus n% number of times. EsCursorLeft:(1) sends one keypress, and increasing n% will send multiple keypresses in a single command.
  337. %EsCursorRight,EsCursorUp,EsCursorDown
  338. EsCursorLeft:(n%)
  339. EsCursorLeftd
  340. Sends a cursor right command to the application/document that has focus n% number of times. EsCursorRight:(1) sends one keypress, and increasing n% will send multiple keypresses in a single command.
  341. $EsCursorLeft,EsCursorUp,EsCursorDown
  342. EsCursorRight:(n%)
  343. EsCursorRightd
  344. Sends a cursor Up command to the application/document that has focus n% number of times. EsCursorUp:(1) sends one keypress, and increasing n% will send multiple keypresses in a single command.
  345. 'EsCursorLeft,EsCursorRight,EsCursorDown
  346. EsCursorUp:(n%)
  347. EsCursorUpd
  348. c_Brings the document/application that currently has focus to the foreground of all other tasks.
  349. ESBackground
  350. EsForeground:
  351. EsForegroundd
  352. Courier
  353. Courier
  354. EsIsCurrentDoc
  355. EsIsCurrentApp%:(appname$)
  356. EsIsCurrentAPPd
  357. Arial
  358. EsEnterKey,EsESCKey,EsMenuKey
  359. EsSendCommand:(key$)
  360. EsSendCommandd
  361. EsSaveSetting
  362. EsLoadSetting$:(SettingName$)
  363. EsLoadSettingd
  364. EsTypeText
  365. EsPasteText:(Text$)
  366. EsPasteTextd
  367. Arial
  368. Arial
  369. Arial
  370. Arial
  371. Arial
  372. Arial
  373. Arial
  374. Arial
  375. EsLoadSetting,Num$(OPL Manual)#EsSaveSetting:(SettingName$,Value$)
  376. EsSaveSettingd
  377. This command hilights the current word (where the cursor is located) in an edit box in the application/document that has focus.
  378. Select,Word,Highlight
  379. U.EsSelectNextWord,EsSelectLastWord,EsSelectLine
  380. EsSelectCurrentWord:
  381. EsSelectCurrentWordd
  382. This command hilights the last word (the word preceeding the current word in a sentence) in an edit box in the application/document that has focus.
  383. Select,Word,Highlight
  384. U1EsSelectNextWord,EsSelectCurrentWord,EsSelectLine
  385. EsSelectLastWord:
  386. EsSelectLastWordd
  387. This command hilights the current line (where the cursor is located) in an edit box in the application/document that has focus.
  388. U2EsSelectNextWord,EsSelectLastWord,EsSelectCurrentW
  389. EsSelectLine:
  390. EsSelectLined
  391. This command hilights the next word (the word following the current word in a sentence) in an edit box in the application/document that has focus.
  392. U1EsSelectLastWord,EsSelectCurrentWord,EsSelectLine
  393. EsSelectNextWord:
  394. EsSelectNextWordd
  395. EsSwitchto:(name$)
  396. EsSwitchto / EsBgSwitchtod
  397. Switches focus to the application that is currently in the foreground. The application launching the macro is always ignored if that is in the foreground.
  398. EsSwitchto
  399. EsSwitchtoCurrentApp:
  400. EsSwitchtoCurrentAppd
  401. c;Switches the focus of macro commands to the System screen.
  402. EsSwitchtoSystem:
  403. EsSwitchtoSystemd
  404. cISwitches the focus of macro commands to Agenda, loading it if necessary.
  405. EsSwitchtoAgenda:
  406. EsSwitchtoAgendad
  407. cGSwitches the focus of macro commands to Data, loading it if necessary.
  408. EsSwitchtoData:
  409. EsSwitchtoDatad
  410. cGSwitches the focus of macro commands to Word, loading it if necessary.
  411. EsSwitchtoWord:
  412. EsSwitchtoWordd
  413. EsWaitforClose
  414. Wait,pause
  415. EsWaitforEnter
  416. EsWaitforSecs
  417. ExtraBars Commands
  418. EbAddExtrabar
  419. @This command  is used to determine whether Switchto commands open files in multiple mode. Normally if you open a database file in EPOC or with Switchto any existing instance of the data application is closed and
  420.  your new document opens it is place. Calling  EsAutoCloseOFF means that any subsequent EsSwitchto commands will launch the targe documents without closing existing instances of the same application.
  421. Example:-
  422. EsAutoCloseOFF:
  423. EsSwitchto:("c:\mydatabase")
  424. EsAutoCloseON:
  425. DThis command adds a new shortcut to the extrabar called bar$ and returns a true (-1) if successful. name$ is the shortcut display name, file$ is the filename of the item to shortcut. app$ is optional  and depends on the typ% parameter:-
  426. typ% can be one of 5 values:-
  427. 1. Application
  428. 2. Document
  429. 3. Web site
  430. 4. Folder
  431. 5. Macro
  432. In all cases, file$ should be the target app file, document, website, folder or macro unless you want to load an application with a specific file in which case app$ is the name of the APP file and file$ is the name of the document.
  433. Examples:
  434. EbAddShortcut%:("Favorites","MyApp",1,"","c:\system\apps\myapp\myapp.app")
  435. EbAddShortcut%:("Favorites","MyApp",2,"z:\system\apps\data\data.app","c:\docs\database.dat")
  436. The first example creates a shortcut to an application, only file$ is used. app$ is left empty.
  437. The second example loads data with a specifc file so app$ is the app filename and file$ is the document.
  438. Look at the Import Hotkeys plugin that comes with ExtraBars to see how these commands can be used.
  439. Courier
  440. Courier
  441. Arial
  442. Times New Roman
  443. Arial
  444. Arial
  445. Arial
  446. CEScript macros can be created in two ways:-
  447. Using the OPL Program editor - Through OPL code, you can create powerful macro applets and launch them within a compatible EScript macro application.
  448. Using OPL allows you to create complex macros with more interaction and application intergration.
  449. Macro "Scriptlets" (future feature) - Scriptlets are macro documents, created from an EScript compatible application such as the EScript Macro recorder. Scriptlets require no programming experience and can be created with simple "plain english"
  450. commands selected from an available vocabulary of commands eg:
  451. Switch to 'Agenda'
  452. Type 'This is a test'
  453. Press the Menu key
  454. With Scriptlets, You don't need to know code or understand how to program at all..
  455. Scriptlet files are registered documents to an EScript player and can be launched by simply double clicking them. In addition, EScript compatible applications can also launch and manage Scriptlet files. (Scriptlets will be supported in a future release of EScript.)
  456. NWhat is a macro?
  457. A macro is a program that can automate tasks you would normally undertake manually. You might create a signature macro that always puts your custom signature on the end of an email when you launch it. 
  458. How do I write macros?
  459. Whether  you are familiar with OPL32 or not then developing macros is very easy as the EScript commands are very simple to use.
  460. In this example we are going to write a simply macro in OPL that pastes the date into the application you are using eg Word.
  461. Before we start let me explain how a macro works.
  462. To control an application you need to make it the focus of your macro commands. 
  463. If the current document or application that is in the foreground is the one you want to recieve focus then EScript automatically uses this application with subsequent macro commands.
  464. Otherwise, EScript has a command called EsSwitchto: which allows you to switch the focus of your commands to a particular application or document that may or may not be running. EsSwitchto can accept application names ie "Agenda" or paths to application files ie "c:\system\apps\Backlite\backlite.app" or document names ie "c:\my documents\agenda".
  465. So, after you switch focus you can then control the application, sending keypresses and pen clicks to simulate a user manually controlling the application or document.
  466. To write our first macro, we need to think through what we want our program to-
  467. 1. Switch to the current application
  468. 2. Paste the date
  469. Quite simple really in plain English but we need to translate this into EScript code.
  470. 1. First, create a new program file in a folder on the system screen. Use Ctrl+N to specify a new file choose PROGRAM and call it something like Datestamp.opl
  471. When the document opens,you should have the following:-
  472. PROC :
  473. This is the default procedure. Type Datestamp (or any other procedure name) before the colon and hit enter so you so you get:-
  474. PROC Datestamp:
  475. Note You can call your procedure by any name. Both EScript and Macro5 use the first procedure in your macro file.
  476. Now we need to add our EPOC Script commands. The first thing to do is tell the macro which application or document to use. Type EsSwitchtoCurrentApp: in the line under the PROC statement. You should now have:-
  477. PROC Datestamp:
  478.  EsSwitchtoCurrentApp:
  479. (Remember, you don't HAVE to put this first line in if the app you want to use is already in the foreground when the macro is run.)
  480. Next, the OPL command for getting the date is DATIM$. This will return a string with the current date and time.
  481. OK, Our macro now has some focus and is ready to control the current application. The quickest way to get text into an application is to paste it so we should use EsPasteText.
  482. Type EsPasteText:(DATIM$) in the line under the EsSwitchto command. You should no have:-
  483. PROC Datestamp:
  484.  EsSwitchtoCurrentApp:
  485.  EsPasteText:(DATIM$)
  486. OK, Our macro is now written. We now need to translate it. Use CTRL+L or press the translate button in the toolbar to translate your macro.
  487. You should now have a file called Datestamp.opo in the same folder as your macro code file (Datestamp).
  488. To add the macro to ExtraBars, make sure EB is running and a bar is displayed. Then use the CTRL+A hotkey or select add shortcut from the shortcut menu.
  489. Select Macro as the type and using the next file dialog, locate the Datestamp.opo file you created. Give your macro a name and EB
  490. then adds it to your current bar.
  491. To Launch the macro, go to the application or document you want to use, open the extrabar containing the macro shortcut and run it. The Date and Time should be pasted into the currently running application or document.
  492. That's it! Your first macro.You can adapt your macro to include settings, user input or other features to make it even more powerful.
  493. Courier
  494. Arial
  495. Courier
  496. Arial
  497. Arial
  498. Arial
  499. Arial
  500. Arial
  501. Arial
  502. Arial
  503. Arial
  504. Arial
  505. Arial
  506. Arial
  507. Arial
  508. Arial
  509. Arial
  510. Arial
  511. Arial
  512. Arial
  513. Arial
  514. Arial
  515. Arial
  516. Arial
  517. Arial
  518. Arial
  519. Arial
  520. Arial
  521. nt EsSwitchto commands will launch the targe documents without closing existing instances of the same application.
  522. Example:-
  523. EsAutoCloseOFF:
  524. EsSwitchto:("c:\mydatabase")
  525. EsAutoCloseON:
  526. DEScript is a new macro language for EPOC computers. Originally started as a macro system for Backlite+Plus, EScript has developed into a more powerful and application independent macro system that allows you to control any application via keystrokes or pen clicks.
  527. EScript compatible applications can provide two levels of Escript support:-
  528. EScript macro commands only - This level of support means you can use all Es prefixed commands to create and run EScript macro applets.
  529. EScript application interface  - This level of support provides additional commands specific to the macro application. These are usually prefixed with a code for the application name. For example ExtraBars has additional commands such as EbAddshortcut etc that allow your macro applets to add new shortcuts to bars. Similarly, Version 2.20 of Backlite+ have additional commands like BLAddSticky that allow you to add a new sticky note.
  530. ExtraBars and Backlite+ support both types of EScript commands
  531. Note EScript supports and is compatible with Backlite+ 2.1 macros (where macro commands start with a BL prefix) although BL macros are no longer supported. It is recommended that you use EScript versions.
  532. ~DUsing the setting feature of EScript you can create powerful macros that allow users to configure options and parameters within a specific settings dialog. Settings are loaded and saved using the EsLoadSettings and EsSaveSettings commands and a common EScript ini file is used so that your settings will be consistant between EScript applications.
  533. It is easy to add a settings dialog to your macro. Simple create a new procedure with the same name as the first Macro procedure with "Settings" joined onto the end of the procedure name.
  534. For example, if the macro macDateStamp.opo has a first procedure called macDateStamp then to add a settings procedure, create a new proedure called macDateStampSettings.
  535. Adding this procdedure means that if the user edits the macro from an EScript application, and presses the settings button associated with the marco, your settings dialog is executed and displayed. This allows you to create macros and plug ins that are tightly integrated wth the host macro language.
  536. (EScript application developers - Use the EsRunMacroSettings: command within your macro launcher to call the settings dialog if it exists)
  537.  Do not use the OPL STOP command in your macros. This has the effect of closing both the macro and the appilcation running it!
  538.  Try to design your dialogs so they conform to the EPOC
  539. standards. This will ensure that your macros work seamlessly with the application running them.
  540.  Make sure the first procedure in the macro file is the start of the macro.
  541. DYou need to use EsLink if you intend to create an application that can run EScript macros or you wish to use EScript commands within your own applications. Before you use this command you must have used mload to load the EScript module into your application.
  542. The best way to use this command is to setup a procedure at the beginning of your app that declares your global variables. Make sure the procedure only contains global variable declaration. Put the rest of your code in another procedure.
  543. Now, put the command Loadm "x:\system\opl\EScript.opo"  (where x: is the drive where the module is installed) into the first procedure under the global declarations and the EsLink command in the next line. Specify Procname$ as the procedure you want to continue execution with. This will ensure that EScript macro variables are added correctly to your app. 
  544. To run EScript macros from your application, use the EsRunMacro command and to all a macros settings routine (if the author has written one), use EsRunMacroSettings command.
  545. PROC Init:
  546.   GLOBAL Myvars%,formy%,app%
  547.   Loadm "c:\system\opl\EScript.opo"
  548.   EsLink:("Main")
  549. PROC Main:
  550.   EsRunMacro:("c:\mymac.opo")
  551. Courier
  552. Courier
  553. Courier
  554. Courier
  555. Wait,pause,freeze
  556. EsWaitforClose:(Message$)
  557. EsWaitforClosed
  558. EScript V1.00.(110)
  559. Welcome
  560. ESDebugOFF
  561. EsDebugON:
  562. EsDebugON:d
  563. Switches the macro debug mode off (default mode) so that macro commands are executed normally.
  564. (See EsDebugON for a full explaination of the EScript debug mode)
  565.     ESDebugON
  566. EsDebugOFF:
  567. EsDebugOFFd
  568. Sends pen down event to the application or document that has macro focus. x and y are the screen co-ordinates to send the pen down event to.
  569. EsPenClick,EsPenMove
  570. EsPenDown:(x&,y&)    EsPenDownd
  571. "Developing your own EScript macros
  572. Tutorial: Writing Macros
  573. Creating Macros
  574. Using EScript
  575. cnSends a pen click event to the application that has focus. x and y are the co-ordinates to send the event to.
  576. EsPenDown,EsPenMove
  577. EsPenClick:(x&,y&)
  578. EsPenClickd
  579. cqSends a pen move event to the application that has focus. x& and y& are the co-ordiantes to move the pointer to.
  580. EsPenDown,EsPenClick
  581. EsPenMove:(x&,y&)    EsPenMoved
  582. KRefer to the EsLink command on how to add Macros to your own applications.
  583. Using EScript.opo&Adding macros to your own applications
  584. EsLink:(Procname$)
  585. EsLink
  586. Using EScript settings
  587. Tutorial: Macro settings
  588. @This command has the opposite effect to the EsAutoCloseOFF command. Calling this command will mean that subsequent Switchto commands will automatically close an existing instance of a document running in the same application.
  589. Example:-=
  590. EsAutoCloseON:
  591. EsSwitchto:("c:\mydatabase")
  592. EsAutoCloseOFF:
  593. iBEScript based applications can support additonal macro commands specific to the application itself.
  594. For convenience, these extra commands are prefixed with a code based on the application. For example ExtraBars uses commands prefixed ith Eb and Backlite+ uses commands prefixed with BL.
  595. These additional commands provide extra functionaity to your macro applets, enabling you to do much more with EScript than simply controlling other applications.
  596. ExtraBars comes with a number of commands that allow your macros to control aspects of ExtraBars itself.
  597. The following pages detail the command listing for ExtraBars.
  598. oBEScript based applications can support additonal macro commands specific to the application itself.
  599. For convenience, these extra commands are prefixed with a code based on the application. For example ExtraBars uses commands prefixed ith Eb and Backlite+ uses commands prefixed with BL.
  600. These additional commands provide extra functionaity to your macro applets, enabling you to do much more with EScript than simply controlling other applications.
  601. Backlite+ comes with a number of commands that allow your macros to control aspects of the application itself.
  602. The following pages detail the command listing for Backlite+.
  603. Backlite+ commands
  604. BLAddStickyNote
  605. BLCurrentStickyText
  606. BLHideBacklite
  607. BLUnhideBacklite
  608. EbAddShortcut
  609. EbHideExtraBar
  610. EbShowExtraBar
  611. Backlite+ commands
  612. BLAddStickyNote
  613. Courier
  614. Courier
  615. Courier
  616. Courier
  617. EsAutoCloseOFF:
  618. EsAutoCloseON:
  619. EsAutoCloseON
  620. EsAutoCloseON
  621. EsAutoCloseOFF:
  622. EsAutoCloseOFF
  623. Runs an EScript (or Macro5 macro if the Macro5 library is installed) macro applet from the main macro running application. Use in conjunction with EsLink within your own applications to provide support for EScript macro modules.
  624. EsLink , EsRunMacroSettings
  625. EsRunMacro:(file$)
  626. EsRunMacro
  627. Clears the clipboard
  628. EsClipText$, EsCopytoClip$
  629. EsClearClip:
  630. EsClearClipd
  631. ExtraBars Commands
  632. SThis command adds an extrabar called Name$. A true (-1) is returned if successful.
  633. EbAddExtrabar%:(Name$)0
  634. EbAddExtrabar
  635. c,This command displays the current ExtraBar.
  636. EbHideExtraBar
  637. EbShowExtraBar:0
  638. EbShowExtraBar0
  639. c)This command hides the current ExtraBar.
  640. EbShowExtraBar
  641. EbHideExtraBar:
  642. EbHideExtraBar
  643. +EbAddShortcut%:(bar$,name$,typ%,app$,file$)
  644. EbAddShortcut
  645. T,Some things to remember when writing macros.
  646. Macro tips
  647. Runs the macro's settings routine if the macro author has written one. A True (-1) is returned if the settings were run and False (0) if they were not found.
  648. EsLink, EsRunMacro
  649. EsRunMacroSettings%:(file$)
  650. EsRunMacroSettings    
  651. kAdds a new sticky called Title$ containing the test in Text$. The note has the default size/zoom settings.
  652. BLAddStickyNote:(Title$,Text$)
  653. BLAddStickyNote,
  654. Backlite+ commands+
  655. c2Returns the selected sticky note text as a string
  656. BLCurrentStickyText$:
  657. BLCurrentStickyText-
  658. Hides the Backlite+ windows (ie toolbar, meters and sticky notes) if you want your macro to come to the foreground to display information without showing Backlite+ itself.
  659. BLUnHideBacklite
  660. BLHideBacklite:
  661. BLHideBacklite.
  662.