User Tools

Site Tools


manual:Scripting

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
manual:Scripting [2017/09/10 22:26]
peternlewis
manual:Scripting [2017/11/06 01:54]
peternlewis added count found in and search and replace
Line 165: Line 165:
 </​code>​ </​code>​
  
-You can ask Keyboard Maestro Engine to process tokens for you with:+You can ask Keyboard Maestro Engine to find strings in other scripts:
  
 <code applescript>​ <code applescript>​
 tell application "​Keyboard Maestro Engine"​ tell application "​Keyboard Maestro Engine"​
-  set clip to process tokens ​"%PastClipboard%3%"+   count found in "The Source"​ for "​.e"​ with regex 
 +end tell 
 +</​code>​ 
 + 
 +And you can search and replace with: 
 + 
 +<code applescript>​ 
 +tell application "​Keyboard Maestro Engine"​ 
 + search "​3+4"​ for "​(\\d+)"​ replace ​"%CalculateFormat%CALCULATE(\\1)%Currency%" ​with regex and process tokens
 end tell end tell
 </​code>​ </​code>​
manual/Scripting.txt · Last modified: 2023/10/04 04:27 by peternlewis