Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
AppleScript for checking value
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Mark FX" data-source="post: 1548681" data-attributes="member: 211556"><p>I dont fully understand your question, but I think your asking how to find a specific word in the frontmost active TextEdit document, if this is correct, then the simple Applescript below shows a very basic way to do this.</p><p></p><p>[CODE]</p><p>tell application "System Events"</p><p> set openApps to name of every application process whose visible is equal to true</p><p> if openApps contains "TextEdit" then</p><p> tell application "TextEdit"</p><p> set the wordList to every word of document 1</p><p> if the wordList contains "Hi" then</p><p> return true</p><p> else</p><p> return false</p><p> end if</p><p> end tell</p><p> else</p><p> display alert "The TextEdit application is not running." giving up after 30</p><p> end if</p><p>end tell</p><p>[/CODE]</p><p></p><p>If this is not what your after, then you had better rephrase your question, and be more clear about what your trying to achieve.</p><p></p><p>Regards Mark</p></blockquote><p></p>
[QUOTE="Mark FX, post: 1548681, member: 211556"] I dont fully understand your question, but I think your asking how to find a specific word in the frontmost active TextEdit document, if this is correct, then the simple Applescript below shows a very basic way to do this. [CODE] tell application "System Events" set openApps to name of every application process whose visible is equal to true if openApps contains "TextEdit" then tell application "TextEdit" set the wordList to every word of document 1 if the wordList contains "Hi" then return true else return false end if end tell else display alert "The TextEdit application is not running." giving up after 30 end if end tell [/CODE] If this is not what your after, then you had better rephrase your question, and be more clear about what your trying to achieve. Regards Mark [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
AppleScript for checking value
Top