• 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
tabs to spaces
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tabs to spaces


  • Subject: tabs to spaces
  • From: Scott Haneda <email@hidden>
  • Date: Sun, 30 Nov 2008 14:04:48 -0800

Hello, I have a client who I am trying to help out, they currently copy out of Excel, paste into Entourage, which seems to convert tabs to spaces, and then copy and paste that out back into Apple Mail.

I am looking for an AppleScript that will convert tabs to spaces. I found one, that was written back in the OS 9 days, and kind of sort of barely works. Seems much more complicated then I need.

I would say, the specs would be:
Split the entire pasteboard into items, so each tab separated item is in an array, you can then find the string length of the longest item.


Knowing the string length of the longest item, an application of "string pad left" or "string pad right" with spaces as the character, would make them all the same length.

A pop up would ask of you want left aligned, or right aligned.

A second pop up would ask, how many spaces each tab should be converted to.

Since this is pasted into email, I think 72 chars wide would be the max, but I would make no effort to do so, if the data is too wide, that is not the goal of this app to solve.

I have a hard time wrapping my head around AppleScript, and am tempted to use php or bash, and wrap that up in an Automator action. Then, I can do it on my own, but I have a feeling that will be a little slow, and this is just basic string manipulation. If this ends up needing an OSAX of some form, I would probably go the bash/php wrapper method.

Can anyone help me get started.
Thanks
--
Scott

_______________________________________________
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: tabs to spaces
      • From: Doug McNutt <email@hidden>
    • Re: tabs to spaces
      • From: Michelle Steiner <email@hidden>
    • Re: tabs to spaces
      • From: Scott Haneda <email@hidden>
    • Re: tabs to spaces
      • From: Skeeve <email@hidden>
    • Re: tabs to spaces
      • From: Skeeve <email@hidden>
    • Re: tabs to spaces
      • From: Skeeve <email@hidden>
  • Prev by Date: Re: Import and export from Applescript variables into Filemaker Pro
  • Next by Date: Re: tabs to spaces
  • Previous by thread: Re: AppleScript-Users Digest, Vol 5, Issue 632
  • Next by thread: Re: tabs to spaces
  • Index(es):
    • Date
    • Thread