• 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
Re: multi-line records?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multi-line records?


  • Subject: Re: multi-line records?
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 24 Feb 2017 04:43:09 -0600

On Feb 24, 2017, at 03:57, S. J. Cunningham <email@hidden> wrote:
The one I hate is the compiler munging up the handler calls.  I haven't figured a way around that.  For example, the aesthetically pleasing:
…
becomes this dog's breakfast:
…
I haven't figured out a way around that.


Hey Steve,

Well – you can get pretty crazy if you want to:

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

set myDialogCall to text 3 thru -4 of "

display dialog      'directParamText' ¬
default answer      'defaultAnswerText' ¬
hidden answer        false ¬
buttons            {'one', 'two', 'three'} ¬
default button      'one' ¬
cancel button       'three' ¬
with title          'withTitleText' with icon 1 ¬
giving up after      30

"

set myDialogCall to findReplTIDS("'", "\"", myDialogCall)

set myDialogCall to run script myDialogCall

---------------------------------------------------
--» HANDLERS
---------------------------------------------------
on findReplTIDS(_find, _replace, _string)
set oldTIDS to AppleScript's text item delimiters
set AppleScript's text item delimiters to _find
set _string to text items of _string
set AppleScript's text item delimiters to _replace
set _string to _string as text
end findReplTIDS
---------------------------------------------------

I'm using single-quotes, so I don't have to have a bunch of escaped double-quotes.

Although it would probably be safer to use a more esoteric character.

I'm using spaces as separator characters to display better in Mail, but tabs will also work.

I'd use the Satimage.osax for find/replace on my own system, but the tids method is fast enough for this job.

** I have plain-text strings set to display as a monospaced font in Script Debugger et al, for exactly this ability to neatly align text.

--
Take Care,
Chris

 _______________________________________________
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: multi-line records?
      • From: "S. J. Cunningham" <email@hidden>
References: 
 >multi-line records? (From: Mitchell L Model <email@hidden>)
 >Re: multi-line records? (From: "S. J. Cunningham" <email@hidden>)

  • Prev by Date: Re: multi-line records?
  • Next by Date: Re: multi-line records?
  • Previous by thread: Re: multi-line records?
  • Next by thread: Re: multi-line records?
  • Index(es):
    • Date
    • Thread