• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Scripting Script Debugger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scripting Script Debugger


  • Subject: Scripting Script Debugger
  • From: Tommy Bollman <email@hidden>
  • Date: Tue, 27 Jul 2010 20:48:25 +0200

Hello.

I'm trying to write a script which doublespaces the lines of the source text, but I'm having a problem with setting the altered source text back. -Any of you guys who knows the right incantation?


This is really work in progress so I only need help with setting the source text to theText

set AppleScript's text item delimiters to ""
set frontAppBid to bid's frontmostBundleId()
haltIfAppIsNotSupported(frontAppBid)
-- return
try
tell application id frontAppBid


tell its script window 1
activate


if frontAppBid is "com.apple.ScriptEditor2" then
set theText to every paragraph of text of its document 1
else if frontAppBid is "com.latenightsw.ScriptDebugger" then
set theText to script source of its document


end if
set {tids, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set theText to text items of theText
-- display dialog "here"


repeat with aPar in theText
set contents of aPar to "" & aPar & return
end repeat
-- set AppleScript's text item delimiters to tids
set theText to theText as text
tell its document


set script source of it to a reference to theText
-- the last thing I tested for
end tell -- of script window 1 to theText
end tell
set AppleScript's text item delimiters to tids
end tell
on error e number n
tell me
activate
display dialog e & ":" & n
end tell
end try






Best regards




Tommy Bollman

--------------------------------------------------------------------------------------------------

Mollison's Bureaucracy Hypothesis:

If an idea can survive a bureaucratic review

and be implemented it wasn't worth doing.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Scripting Script Debugger
      • From: "Stockly, Ed" <email@hidden>
  • Prev by Date: Re: Is there any way to move to a certain position in AppleScript Editor 2.3
  • Next by Date: Password Copy & Paste
  • Previous by thread: Re: Is there any way to move to a certain position in AppleScript Editor 2.3
  • Next by thread: Re: Scripting Script Debugger
  • Index(es):
    • Date
    • Thread