tabs to spaces
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