• 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: Comma delimited paragraph Ver2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comma delimited paragraph Ver2


  • Subject: Re: Comma delimited paragraph Ver2
  • From: "email@hidden" <email@hidden>
  • Date: Mon, 12 Jun 2017 13:18:59 -0500

David Gregg’s script was spot-on, and I can’t tell you all how much I
appreciate your responses.  Because that script has been so helpful in my
workflow,  I’m wondering if I could get some help on 2 similar scenarios:

Same deal….I just need the clipboard formatted.

Scenario 1)    Per  the example below, but I need the clipboard contents to
paste in one column with a carriage return at the end of each entry:

So, 2666402402: 2666838403 2651918574 2603572532 2524040907 2570477380
2557200473 2576205981      needs to paste:

2666402402
:
2666838403
,
2651918574
2603572532
,
 2524040907
 2570477380
 2557200473
 2576205981

As long as there is a carriage return after each entry, the search box that I’m
using will disregard whatever punctuation is on it’s own line, and just search
for the strings that are valid (as long as there are no leading spaces).


Scenario 2)

The clipboard would contain a string anywhere from 9 to about 20 characters,
being a mix of upper/lower/numbers.  I just need it to be truncated to the
final
4 characters,regardless of what they are.

 Any takers?    Thanks in advance for making my job a bit more bearable!!


 AG

> On May 18, 2017, at 10:08 AM, David Gregg <email@hidden> wrote:
>
> Here is a method using standard AppleScript. This is assuming the original
> content is already on the clipboard.
>
> set originalContent to the clipboard
> set values to every word of originalContent
> set csvContent to ""
> repeat with i from 1 to count of values
>       set csvContent to csvContent & item i of values
>       if i < (count of values) then set csvContent to csvContent & ","
> end repeat
> set the clipboard to csvContent
>
> return the clipboard
>
>> On May 18, 2017, at 8:03 AM, email@hidden wrote:
>>
>> Hello,
>>
>> I have a list of 10 digit order number that come from a variety of sources,
>> including excel spreadsheets and email.  I’m trying to figure out how to
>> copy the list and format the clipboard
>> to be comma delimited, deleting any carriage returns, empty lines, spaces,
>> etc
>>
>> What I have is:
>>
>>
>> 2666402402
>> 2666838403
>> 2651918574
>> 2603572532
>> 2524040907
>> 2570477380
>> 2557200473
>> 2576205981
>> 2665747816
>> 2673705862
>> 2660671146
>>
>>
>> or:  2666402402: 2666838403,  2651918574 2603572532, 2524040907 2570477380
>> 2557200473 2576205981
>>  2665747816 2673705862 2660671146
>>
>>
>> What I need is:
>>
>> 2666402402,2666838403,2651918574,2603572532,2524040907,2570477380,2557200473,2576205981,2665747816,2673705862,2660671146
>>
>>
>> Any help GREATLY appreciated!
>>
>> AG
>>
>> _______________________________________________
>> 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
>

 _______________________________________________
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

  • Prev by Date: Re: plist files instead of properties
  • Next by Date: Re: Setting a File or Folder Icon via AppleScript
  • Previous by thread: Re: plist files instead of properties
  • Next by thread: Permissions problem mac OS X 10.9.5 server
  • Index(es):
    • Date
    • Thread