Page 1 of 1
repeat with ....
Posted: Fri Jul 07, 2017 3:11 am
by RossG
I recall that I asked this question previously but can't
find the answer...
Repeat with a long line of field names so want to separate into
shorter lines. It requires a "/" but is it ...name,name," / ?
Haven't been able to get the right combination (again).
Re: repeat with ....
Posted: Fri Jul 07, 2017 4:37 am
by dunbarx
Hi.
Not sure at all what you are asking. Are you taking about a repeat loop or separating lines in the script editor?
Can you rephrase?
Craig Newman
Re: repeat with ....
Posted: Fri Jul 07, 2017 8:12 am
by bogs
The way I read the question, what your looking for is to separate lines into shorter lines. In that case, the slash you have in the question is the wrong one.
From the dictionary:
The character \ is used to break a line in a script for display, while still having it treated as a single statement.
Examples:
answer "You've been waiting for" numberOfMinutes \
"minutes." with "Keep Waiting" or "Cancel"
As for loosing previous questions you asked, you can always go to your user control panel to view previous posts you made, or alternately, go to advanced search and type your user name in the 2nd box, all your posts should come up
*Edit - in the case of your remembering a previous post, the advanced search/your name gave me
this with no other search terms, on page 11.
Re: repeat with ....
Posted: Sat Jul 08, 2017 12:16 am
by RossG
Thanks bogs.
Did search my previous post without success.
I think it may have been a subsidiary question
in a post not related to this question.
Re: repeat with ....
Posted: Sat Jul 08, 2017 8:26 am
by [-hh]
@RossG. You are looking for the line continuation char backslash ("\").
An example for a string:
Code: Select all
"part 1 of string, part 2 of string"
is the same as
Code: Select all
"part 1 of string, " & \
"part 2 of string"
@bogs. You forgot in your example twice the concatenation "&" (and the space).
bogs wrote:answer "You've been waiting for" numberOfMinutes \
"minutes." with "Keep Waiting" or "Cancel"
The above should read:
Code: Select all
answer "You've been waiting for " & numberOfMinutes & \
" minutes." with "Keep Waiting" or "Cancel"
Re: repeat with ....
Posted: Sat Jul 08, 2017 5:55 pm
by bogs
Ross, happy I could help

You will often find this stuff in the dictionary quickly even if you put the wrong character in initially, for instance "/"
would have brought up division, tipping you reversing it would be the likely answer. Just make sure to read the whole page, as -hh points out ....
Heya -hh
Good catch, but it was not my example.
However, I didn't read the whole page,and I probably should have !
As -hh and the comment at the bottom of the page correctly point out, concatenation is required. My apologies for posting too quickly
