Menu

#1364 scripting, applescript "contents"/"text"

closed
nobody
None
5
2015-02-16
2009-02-09
Anonymous
No

from: harold@dominofilms.co.uk

In Tiger & Leopard

Create this script (instead of "something", choose a word which is displayed in the 1st session window of the 1st terminal) and run it:

tell application "iTerm"
tell session 1 of terminal 1
if contents contains "something" then
write text "#OK"
end if
-- OK
end tell
end tell

The script compiles replacing "contents" with "text" and then runs as it should: "#OK" appears as specified at the prompt.

Change the comment from "-- OK" to anything else. Recompile and run the script: nothing appears at the prompt.

(I suspect that the first time the script runs, "contents" translates to the correct raw chevron code but the second time, being seen to be "text" rather than "contents" it is mistranslated.)

It makes writing scripts that depend on host names, prompts etc as seen in the terminal quite tricky.

Discussion

  • James Bunton

    James Bunton - 2009-02-10

    I can reproduce this.

     
  • James Bunton

    James Bunton - 2009-04-15

    Due to its age, this bug report has been marked as pending.
    Please check to see if the bug still occurs with the latest release. If it does, either reopen this bug or create a new one.

    Thank you.

     
  • James Bunton

    James Bunton - 2009-04-15
    • status: open --> pending
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB