home *** CD-ROM | disk | FTP | other *** search
/ PSION CD 2 / PsionCDVol2.iso / Programs / 853 / ExtraBarsSIS.sis / EScript.SIS / EScript.hlp (.txt) next >
Encoding:
EPOC Database  |  2000-09-28  |  58.6 KB  |  702 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. EsESCKey
  93. EsMenuKey
  94. ESSaveSetting
  95. EbAddExtrabar
  96. EbShowExtraBar
  97. (Event) EbEvRunShortcut
  98. (Event) EbEvAddShortcut
  99. ESSelectCurrentWord
  100. Select,Wor
  101. ESSelectNextWord
  102. ESSelectCurrentWord
  103. Select,Wor
  104. ESSelectNextWord
  105. ESSelectCurrentWord
  106. Select,Wor
  107. ESSelectNextWord
  108. ESSelectCurrentWord
  109. Select,Wor
  110. ESSelectNextWord
  111. ESSelectCurrentWord
  112. Select,Wor
  113. ESSelectNextWord
  114. ESSelectCurrentWord
  115. Select,Wor
  116. ESSelectNextWord
  117. ESSelectCurrentWord
  118. Select,Wor
  119. ESSelectNextWord
  120. ESSelectCurrentWord
  121. Select,Wor
  122. ESSelectNextWord
  123. ESSelectCurrentWord
  124. Select,Wor
  125. ESSelectNextWord
  126. ESSelectCurrentWord
  127. Select,Wor
  128. ESSelectNextWord
  129. ESSelectCurrentWord
  130. Select,Wor
  131. ESSelectNextWord
  132. ESSelectCurrentWord
  133. Select,Wor
  134. ESSelectNextWord
  135. APauses execution of the macro until the user presses the ENTER
  136. key. 
  137. 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.
  138. 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.
  139. EsSetBackground
  140. background
  141. EsSetForeground
  142. EsShowTasklist
  143. EsSwitchto / EsBgSwitchto
  144. ESSwitchtoAgenda
  145. ESSelectCurrentWord
  146. Select,Wor
  147. ESSelectLastWord
  148. Select,Wor
  149. ESSelectLine
  150. ESSelectNextWord
  151. EsSendCommand
  152. 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).
  153. EsEnterKey
  154. EsESCKey
  155. ESForeground
  156. ESCursorUp
  157. EsDebugOFF
  158. ESDebugON:
  159. EsESCKey
  160. ESForeground
  161. 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.
  162. Example:-
  163. If EsIsCurrentApp%:("Agenda")
  164.    Do stuff here
  165. ENDIF
  166. Arial
  167. Arial
  168. Courier
  169. Arial
  170. Arial
  171. Arial
  172. Arial
  173. Arial
  174. Arial
  175. f here
  176. ENDIF
  177. xBSends the Macro application to the background of the currently running tasks eg:-
  178. PROC macHelloWorld:
  179.     EsMacroApptoFront:
  180.     GIPRINT "Hello World"
  181.     EsMacroApptoBack:
  182. 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)
  183. cHSwitches the focus of macro commands to Sheet, loading it if necessary.
  184. EsSwitchtoSheet:
  185. EsSwitchtoSheetd
  186. c.Switches the focus of macro commands to Calc.
  187. EsSwitchtoCalc:
  188. EsSwitchtoCalcd
  189. Switches the focus of macro commands to Sketch, loading it if necessary.
  190. 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"
  191. EsSwitchtoSketch:
  192. EsSwitchtoSketchd
  193. Switches the focus of macro commands to Email.
  194. 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"
  195. EsSwitchtoEmail:
  196. EsSwitchtoEmaild
  197. Switches the focus of macro commands to Browser.
  198. 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"
  199. EsSwitchtoWeb:
  200. EsSwitchtoWebd
  201. c>Displays the current tasklist of open documents/applications.
  202. EsShowTasklist:
  203. EsShowTasklistd
  204. EsPasteText
  205. EsTypeText:(Text$)
  206. EsTypeTextd
  207.     ESClickOK
  208. EsWaitforEnter:
  209. EsWaitforEnterd
  210. cRWaits for a the number of seconds specified in secs% before continuing execution.
  211. EsWaitforSecs:(secs%)
  212. EsWaitforSecsd
  213. Courier
  214. Courier
  215. EsCopy$:
  216. EsCopy$d
  217. Courier
  218. Courier
  219. Courier
  220. Courier
  221. Arial
  222. Arial
  223. Arial
  224. Arial
  225. yBBrings the Macro application to the foreground of the currently running tasks eg:-
  226. PROC macHelloWorld:
  227.     EsMacroApptoFront:
  228.     GIPRINT "Hello World"
  229.     EsMacroApptoBack:
  230. 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)
  231. Courier
  232. Courier
  233. Courier
  234. Courier
  235. Courier
  236. Courier
  237. Courier
  238. Courier
  239. Arial
  240. Arial
  241. Arial
  242. Arial
  243. _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.
  244. 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.
  245. Settings example:-
  246. To save a string use EsSaveSetting:("UserName","John Smith")
  247. To save a number use EsSaveSetting:("HideWin",num$(Hidewin%,1))
  248. The num$ command has two parameters, a number variable to convert, and a length of characters to convert it to.
  249. 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.
  250. 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.
  251. Adding macros to your own applications
  252. Macro tips
  253. EsAutoCloseON
  254. EsAutoCloseON
  255. EsAutoCloseON
  256. Welcome
  257. Using EScript
  258. Tutorial: Writing Macros
  259. Tutorial: Macro settings
  260. Tutorial: Macro settings
  261. CSwitches the focus of macro commands to the application or document specified as name$.
  262. 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. 
  263. 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. 
  264. 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.
  265. Examples:-
  266. EsSwitchto:("Word") 
  267. EsBgSwitchto:("c:\Jotter") 
  268. EsSwitchto:("c:\system\apps\Psizip\Psizip.APP") 
  269. In addition to this command, you can use the in-built shortcuts to access the main Series 5 applications:-
  270. 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:
  271. EsRunMacroSettings
  272. EsAskforTimeInput
  273. EsClearClip
  274. ESClipText
  275. ESClipText
  276. EsLink
  277. EsAutoCloseOFF
  278. EsAutoCloseON
  279. EsRunMacro
  280. EsAskforTimeInput
  281. _AHalts execution of any futher Macro commands until the current application or document that has the focus has been exited.
  282. Example:-
  283. EsSwitchto:("Help.dbf")
  284. EsWaitforClose:("Waiting for exit..")
  285. 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.
  286. >c:\Help-017Temp
  287. Table1C
  288. .Description
  289. 2Program name
  290. "Keywords
  291. "See Also
  292. Usage
  293. Title
  294. Order
  295. EsWaitforClose
  296. Wait,pause
  297. EsWaitforEnter
  298. EsWaitforSecs
  299. ExtraBars Commands
  300. EbAddExtrabar
  301. AThis 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 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.
  302. Example:-
  303. EsAutoCloseOFF:
  304. EsSwitchto:("c:\mydatabase")
  305. EsAutoCloseON:
  306. Arial
  307. Times New Roman
  308. Arial
  309. Arial
  310. Arial
  311. CEScript macros can be created in two ways:-
  312. Using the OPL Program editor - Through OPL code, you can create powerful macro applets and launch them within a compatible EScript macro application.
  313. Using OPL allows you to create complex macros with more interaction and application intergration.
  314. 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"
  315. commands selected from an available vocabulary of commands eg:
  316. Switch to 'Agenda'
  317. Type 'This is a test'
  318. Press the Menu key
  319. With Scriptlets, You don't need to know code or understand how to program at all..
  320. 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.)
  321. Courier
  322. Arial
  323. Courier
  324. Arial
  325. Arial
  326. Arial
  327. Arial
  328. Arial
  329. Arial
  330. Arial
  331. Arial
  332. Arial
  333. Arial
  334. Arial
  335. Arial
  336. Arial
  337. Arial
  338. Arial
  339. Arial
  340. Arial
  341. Arial
  342. Arial
  343. Arial
  344. Arial
  345. Arial
  346. Arial
  347. Arial
  348. Arial
  349. )AThis 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.
  350. Example:-
  351. EsAutoCloseON:
  352. EsSwitchto:("c:\mydatabase")
  353. EsAutoCloseOFF:
  354. rst procedure in the macro file is the start of the macro.
  355. Courier
  356. Courier
  357. ~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.
  358. 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.
  359. 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.
  360. 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.
  361. (EScript application developers - Use the EsRunMacroSettings: command within your macro launcher to call the settings dialog if it exists)
  362. @You 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 
  363. you use this command you must have used mload to load the EScript module into your application.
  364. 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.
  365. 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. 
  366. 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.
  367. PROC Init:
  368.   GLOBAL Myvars%,formy%,app%
  369.   Loadm "c:\system\opl\EScript.opo"
  370.   EsLink:("Main")
  371. PROC Main:
  372.   EsRunMacro:("c:\mymac.opo")
  373. iBEScript based applications can support additonal macro commands specific to the application itself.
  374. 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.
  375. These additional commands provide extra functionaity to your macro applets, enabling you to do much more with EScript than simply controlling other applications.
  376. ExtraBars comes with a number of commands that allow your macros to control aspects of ExtraBars itself.
  377. The following pages detail the command listing for ExtraBars.
  378. oBEScript based applications can support additonal macro commands specific to the application itself.
  379. 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.
  380. These additional commands provide extra functionaity to your macro applets, enabling you to do much more with EScript than simply controlling other applications.
  381. Backlite+ comes with a number of commands that allow your macros to control aspects of the application itself.
  382. The following pages detail the command listing for Backlite+.
  383. EbAddShortcut
  384. EbCurrentExtrabar
  385. EbGetType
  386. EbHideExtraBar
  387. EbShowExtraBar
  388. AEsLoadSetting is broken down into 3 different procedures, each one returning either a string, integer or long.
  389. EsLoadSetting$ returns a string variable containing a setting stored under the name SettingName$ 
  390. EsLoadSetting% returns an integer of the value stored in SettingName$ and
  391. EsLoadSetting& returns a long of the value stored in SettingName$
  392. All settings are stored within the EPOC Script settings file store in c:\system\data\ESSettings.ini.
  393. elease of EScript.)
  394. NWhat is a macro?
  395. 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. 
  396. How do I write macros?
  397. Whether  you are familiar with OPL32 or not then developing macros is very easy as the EScript commands are very simple to use.
  398. 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.
  399. Before we start let me explain how a macro works.
  400. To control an application you need to make it the focus of your macro commands. 
  401. 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.
  402. 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".
  403. 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.
  404. To write our first macro, we need to think through what we want our program to-
  405. 1. Switch to the current application
  406. 2. Paste the date
  407. Quite simple really in plain English but we need to translate this into EScript code.
  408. 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
  409. When the document opens,you should have the following:-
  410. PROC :
  411. This is the default procedure. Type Datestamp (or any other procedure name) before the colon and hit enter so you so you get:-
  412. PROC Datestamp:
  413. Note You can call your procedure by any name. Both EScript and Macro5 use the first procedure in your macro file.
  414. 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:-
  415. PROC Datestamp:
  416.  EsSwitchtoCurrentApp:
  417. (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.)
  418. Next, the OPL command for getting the date is DATIM$. This will return a string with the current date and time.
  419. 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.
  420. Type EsPasteText:(DATIM$) in the line under the EsSwitchto command. You should no have:-
  421. PROC Datestamp:
  422.  EsSwitchtoCurrentApp:
  423.  EsPasteText:(DATIM$)
  424. 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.
  425. You should now have a file called Datestamp.opo in the same folder as your macro code file (Datestamp).
  426. 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.
  427. 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
  428. then adds it to your current bar.
  429. 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.
  430. 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.
  431. AThis is a callback event within ExtraBars. This means that when the user edits the properties  of a shortcut, this event is called and if a macro module exists within the <appdrive>\system\apps\extrabars\pluginevents folder contains this procedure, then the procedure is called AFTER the shortcut is edited. This allows you to write macros that append dialogs or extra instruction after a shortcut is edited.
  432. store in c:\system\data\ESSettings.ini.
  433. Courier
  434. Courier
  435. EsIsCurrentDoc
  436. EsIsCurrentApp%:(appname$)
  437. EsIsCurrentAPPd
  438. Arial
  439. EsEnterKey,EsESCKey,EsMenuKey
  440. EsSendCommand:(key$)
  441. EsSendCommandd
  442. EsSaveSetting&EsLoadSetting$ / % / & :(SettingName$)
  443. EsLoadSettingd
  444. EsTypeText
  445. EsPasteText:(Text$)
  446. EsPasteTextd
  447. Arial
  448. Arial
  449. Arial
  450. Arial
  451. Arial
  452. Arial
  453. Arial
  454. Arial
  455. EsLoadSetting,Num$(OPL Manual)#EsSaveSetting:(SettingName$,Value$)
  456. EsSaveSettingd
  457. This command hilights the current word (where the cursor is located) in an edit box in the application/document that has focus.
  458. Select,Word,Highlight
  459. U.EsSelectNextWord,EsSelectLastWord,EsSelectLine
  460. EsSelectCurrentWord:
  461. EsSelectCurrentWordd
  462. 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.
  463. Select,Word,Highlight
  464. U1EsSelectNextWord,EsSelectCurrentWord,EsSelectLine
  465. EsSelectLastWord:
  466. EsSelectLastWordd
  467. This command hilights the current line (where the cursor is located) in an edit box in the application/document that has focus.
  468. U2EsSelectNextWord,EsSelectLastWord,EsSelectCurrentW
  469. EsSelectLine:
  470. EsSelectLined
  471. 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.
  472. U1EsSelectLastWord,EsSelectCurrentWord,EsSelectLine
  473. EsSelectNextWord:
  474. EsSelectNextWordd
  475. EsSwitchto:(name$)
  476. EsSwitchto / EsBgSwitchtod
  477. 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.
  478. EsSwitchto
  479. EsSwitchtoCurrentApp:
  480. EsSwitchtoCurrentAppd
  481. c;Switches the focus of macro commands to the System screen.
  482. EsSwitchtoSystem:
  483. EsSwitchtoSystemd
  484. cISwitches the focus of macro commands to Agenda, loading it if necessary.
  485. EsSwitchtoAgenda:
  486. EsSwitchtoAgendad
  487. cGSwitches the focus of macro commands to Data, loading it if necessary.
  488. EsSwitchtoData:
  489. EsSwitchtoDatad
  490. cGSwitches the focus of macro commands to Word, loading it if necessary.
  491. EsSwitchtoWord:
  492. EsSwitchtoWordd
  493. cADisplays the menu of the application or document that has focus.
  494. EsSwitchto
  495. EsMenuKey:    EsMenuKeyd
  496. 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:
  497. EsTypeText#EsAskforTimeInput$:(Title$,Prompt$)
  498. EsAskforTimeInputd
  499. c^Sends the document/application that currently has focus to the background of all other tasks.
  500. %background,foreground,order,priority
  501. EsSetForeground
  502. EsSetBackground:
  503. EsSetBackgroundd
  504. back,priority,order,backlite
  505. EsMacroApptoBack
  506. EsMacroApptoFront:
  507. EsMacroApptoFrontd
  508. ESBacklitetoFront
  509. EsMacroApptoBack:
  510. EsMacroApptoBackd
  511. 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)
  512. EsEnterKey
  513. EsESCKey
  514. EsESCKeyd
  515. 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).
  516. EsESCKey
  517. ESEnterKey:
  518. EsEnterKeyd
  519. EsCopytoClip,EsCopy$
  520. EsClipText$
  521. EsClipTextd
  522. c5Copies the text specified in text$ to the clipboard.
  523. EsClipText, EsCopy$
  524. EsCopytoClip:(text$)
  525. EsCopytoClipd
  526. 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.
  527. $EsCursorUp,ECursorLeft,EsCursorRight
  528. EsCursorDown:(n%)
  529. EsCursorDownd
  530. 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.
  531. %EsCursorRight,EsCursorUp,EsCursorDown
  532. EsCursorLeft:(n%)
  533. EsCursorLeftd
  534. 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.
  535. $EsCursorLeft,EsCursorUp,EsCursorDown
  536. EsCursorRight:(n%)
  537. EsCursorRightd
  538. 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.
  539. 'EsCursorLeft,EsCursorRight,EsCursorDown
  540. EsCursorUp:(n%)
  541. EsCursorUpd
  542. c_Brings the document/application that currently has focus to the foreground of all other tasks.
  543. ESetBackground
  544. EsSetForeground:
  545. EsSetForegroundd
  546. IDThis 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:-
  547. typ% can be one of 5 values:-
  548. 1. Application
  549. 2. Document
  550. 3. Web site
  551. 4. Folder
  552. 5. Macro
  553. 6. Template
  554. 7. ClipText
  555. In all cases, file$ should be the target app file, document, website, folder, macro, template or ClipText (ASCII) file 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.
  556. Examples:
  557. EbAddShortcut%:("Favorites","MyApp",1,"","c:\system\apps\myapp\myapp.app")
  558. EbAddShortcut%:("Favorites","MyApp",2,"z:\system\apps\data\data.app","c:\docs\database.dat")
  559. The first example creates a shortcut to an application, only file$ is used. app$ is left empty.
  560. The second example loads data with a specifc file so app$ is the app filename and file$ is the document.
  561. Look at the Import Hotkeys plugin that comes with ExtraBars to see how these commands can be used.
  562. Courier
  563. Courier
  564. AThis command displays a dialog where the user can select an extrabar. The name of the bar is returned as a string or "" (nothing) is returned if the user presses CANCEL. Title$ is the title of the dialog, Line1$ and Line2$ specify text for the first two lines of the dialog and Prompt$ is the text to display next to the list of bars, eg "Select bar".
  565. This command is useful for even based macros or plugin macros where you want the user to specify an extrabar.
  566. Backlite+ commands
  567. BLAddStickyNote
  568. BLCurrentStickyText
  569. BLHideBacklite
  570. BLUnhideBacklite
  571.  Avoid using gUSE 1 commands. This is the default wi
  572. ndow and is probably used by the macro application.
  573.  Do not use the OPL STOP command in your macros. This has the effect of closing both the macro and the appilcation running it!
  574.  Try to design your dialogs so they conform to the EPOC
  575. standards. This will ensure that your macros look seamless and part of the application running them.
  576.  Make sure the first procedure in the macro file is the start of the macro.
  577. AThis is a callback event within ExtraBars. This means that when the user edits the name of a shortcut, this event is called and if a macro module exists within the <appdrive>\system\apps\extrabars\pluginevents folder contains this procedure, then the procedure is called AFTER the shortcut is edited. This allows you to write macros that append dialogs or extra instruction after a shortcut is edited.
  578. Courier
  579. Courier
  580. Courier
  581. Courier
  582. EsAutoCloseOFF:
  583. EsAutoCloseON:
  584. EsAutoCloseON
  585. EsAutoCloseON
  586. EsAutoCloseOFF:
  587. EsAutoCloseOFF
  588. 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.
  589. EsLink , EsRunMacroSettings
  590. EsRunMacro:(file$)
  591. EsRunMacro
  592. Clears the clipboard
  593. EsClipText$, EsCopytoClip$
  594. EsClearClip:
  595. EsClearClipd
  596. ExtraBars Commands
  597. SThis command adds an extrabar called Name$. A true (-1) is returned if successful.
  598. EbAddExtrabar%:(Name$)0
  599. EbAddExtrabar
  600. c,This command displays the current ExtraBar.
  601. EbHideExtraBar
  602. EbShowExtraBar:0
  603. EbShowExtraBar0
  604. c)This command hides the current ExtraBar.
  605. EbShowExtraBar
  606. EbHideExtraBar:
  607. EbHideExtraBar
  608. +EbAddShortcut%:(bar$,name$,typ%,app$,file$)
  609. EbAddShortcut
  610. T,Some things to remember when writing macros.
  611. Macro tips
  612. 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.
  613. EsLink, EsRunMacro
  614. EsRunMacroSettings%:(file$)
  615. EsRunMacroSettings    
  616. kAdds a new sticky called Title$ containing the test in Text$. The note has the default size/zoom settings.
  617. BLAddStickyNote:(Title$,Text$)
  618. BLAddStickyNote,
  619. Backlite+ commands+
  620. c2Returns the selected sticky note text as a string
  621. BLCurrentStickyText$:
  622. BLCurrentStickyText-
  623. 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.
  624. BLUnHideBacklite
  625. BLHideBacklite:
  626. BLHideBacklite.
  627. AThis is a callback event within ExtraBars. This means that when the user adds a new shortcut, this event is called and if a macro module exists within the <appdrive>\system\apps\extrabars\pluginevents folder contains this procedure, then the procedure is called AFTER the shortcut is added. This allows you to write macros that append dialogs or extra instruction after a shortcut is edited.
  628. (Event) EbEvEditShortcut
  629. (Event) EbEvEditShortcutName
  630. (Event) EbEvAddShortcut
  631. EbRunShortcut
  632. EbSelectBar
  633. (Event) EbEvRunShortcut
  634. (Event) EbEvEditShortcutName
  635. (Event) EbEvAddShortcut
  636. BThis routine is usually called from an Event script when you have been passed the information relating to the shortcut. Call this routine to launch the shortcut based on the parameters name$, for the caption name, type%, for the shortcut type, app$/file$, for the application or filename to open.
  637. You can of course use this command to launch any file as long as you specify the correct type%. For example, to launch a Word document called Mydoc1, the command would be:-
  638. EbRunShortcut%:("MyDoc1",2,"z:\system\apps\word\word.app","c:\Mydoc1")
  639. 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.
  640. EScript compatible applications can provide two levels of Escript support:-
  641. EScript macro commands only - This level of support means you can use all Es prefixed commands to create and run EScript macro applets.
  642. 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.
  643. ExtraBars and Backlite+ support both types of EScript commands
  644. 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.
  645. Courier
  646. Courier
  647. Wait,pause,freeze
  648. EsWaitforClose:(Message$)
  649. EsWaitforClosed
  650. EScript V1.10F (Build 120)
  651. Welcome
  652. ESDebugOFF
  653. EsDebugON:
  654. EsDebugON:d
  655. Switches the macro debug mode off (default mode) so that macro commands are executed normally.
  656. (See EsDebugON for a full explaination of the EScript debug mode)
  657.     ESDebugON
  658. EsDebugOFF:
  659. EsDebugOFFd
  660. 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.
  661. EsPenClick,EsPenMove
  662. EsPenDown:(x&,y&)    EsPenDownd
  663. "Developing your own EScript macros
  664. Tutorial: Writing Macros
  665. Creating Macros
  666. Using EScript
  667. cnSends a pen click event to the application that has focus. x and y are the co-ordinates to send the event to.
  668. EsPenDown,EsPenMove
  669. EsPenClick:(x&,y&)
  670. EsPenClickd
  671. cqSends a pen move event to the application that has focus. x& and y& are the co-ordiantes to move the pointer to.
  672. EsPenDown,EsPenClick
  673. EsPenMove:(x&,y&)    EsPenMoved
  674. KRefer to the EsLink command on how to add Macros to your own applications.
  675. Using EScript.opo&Adding macros to your own applications
  676. EsLink:(Procname$)
  677. EsLink
  678. Using EScript settings
  679. Tutorial: Macro settings
  680. FBThis is a callback event within ExtraBars. This means that when the user launches a shortcut, this event is called and if a macro module exists within the <appdrive>\system\apps\extrabars\pluginevents folder cotains this procedure, then the procedure is called BEFORE the shortcut is launched. This allows you to write macros that append dialogs or extra instruction onto a luanch command before you run the shortcut. Passing KTrue% (-1) back as a return value has the effect of stopping the launch from occurring and KFalse% (0) will inform EB to continue and launch the shortcut.
  681. c=Restores the windows hidden with the BLHideBacklite command.
  682. BLHideBacklite
  683. BLUnhideBacklite:
  684. BLUnhideBacklite0
  685. jReturns a string description of the Shortcut type specified as Type%. For example "Document", "Macro" etc
  686. EbGetType$:(type%)    EbGetType
  687. c1Returns the name of the current bar as a string.
  688. EbCurrentextrabar$:
  689. EbCurrentExtrabar
  690. +EbSelectBar$:(Title$,Line1$,Line2$,Prompt$)
  691. EbSelectBar
  692. EbEvRunShortcut%:(n$,a$,f$,t%)
  693. (Event) EbEvRunShortcut
  694. T2EbEvEditShortcutName%:(oN$,nN$,oA$,nA$,oF$,nF$,t%)
  695. (Event) EbEvEditShortcut
  696. T(EbEvEditShortcutName%:(oN$,nN$,a$,f$,t%)
  697. (Event) EbEvEditShortcutName
  698. T#EbEvEditShortcutName%:(N$,A$,F$,t%)
  699. (Event) EbEvAddShortcut
  700. 'EbRunShortcut%:(name$,Type%,app$,File$)
  701. EbRunShortcut
  702.