Friday, July 20, 2018

#26 2017-08-20 02:13:18 pm

From:: United Kingdom
Registered: 2017-02-03
Posts: 47

Re: Automatically Create One line from multiple lines of input

Can anyone help me with the issue?

Prescience wrote:

UPDATE: PM 2017-08-15

This code does as intended, with one small problem when used in the real world with longs strings of text, and more than 45 lines!  The text that appears in the output box is so long I can't copy all of it!

Would it be possible to offer a 'copy to clipboard' button, or output the text in another manor that will make copying the final result full proof?

This works perfectly. Thank you.

haolesurferdude wrote:

Select a single column of your data starting with the first row of data thru the last row of data in Excel.  Then, run the following AppleScript:


use framework "Foundation"
use framework "OSAKit"
use scripting additions

tell application "Microsoft Excel"
   set rowCount to count of rows of selection
   set myString to "" as text
   repeat with j from 1 to rowCount
       set myString to myString & (value of row j of selection) as text
       if j < rowCount then
           set myString to myString & return as text
       end if
   end repeat
end tell

display dialog (((current application's OSAScript's alloc()'s initWithSource:("paragraphs from word 1 to word -1 of \"" & myString & "\""))'s executeAndReturnDisplayValue:(reference) |error|:(missing value))'s end's |string|() as text)

Wisdom is knowing the power of experience, understanding the knowledge learnt on your personal journey through time, and having the empathy to share with others.



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)