Thursday, September 21, 2017

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

Prescience
Member
From:: United Kingdom
Registered: 2017-02-03
Posts: 43

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:

Applescript:


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

tell application "Microsoft Excel"
   activate
   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

activate
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.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)