Welcome to MacForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Paragraph jumper

 
   Macintosh computer (Home) -> Apple Scripts RSS
Next:  Clearing out /Library/Receipts  
Author Message
Jo_y

External


Since: Jun 22, 2008
Posts: 30



(Msg. 1) Posted: Fri Nov 21, 2008 7:50 am
Post subject: Paragraph jumper
Archived from groups: alt>comp>lang>applescript (more info?)

Hello, applescripters
is there a way to jump to a specific paragraph in "Script Editor"
documents by using a applescript?
(stored in the "SCRIPT Editor Scripts" folder of the system domain
path- executable in other words, from the contextual menu of "Script
Editor" itself)

(to make more easy the navigation into the front document)

 >> Stay informed about: Paragraph jumper 
Back to top
Login to vote
Jolly Roger

External


Since: Sep 09, 2006
Posts: 3131



(Msg. 2) Posted: Fri Nov 21, 2008 11:46 am
Post subject: Re: Paragraph jumper [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
Jo_y wrote:

> Hello, applescripters
> is there a way to jump to a specific paragraph in "Script Editor"
> documents by using a applescript?
> (stored in the "SCRIPT Editor Scripts" folder of the system domain
> path- executable in other words, from the contextual menu of "Script
> Editor" itself)
>
> (to make more easy the navigation into the front document)

Probably. What do you mean by "jump to", exactly?

Have you looked at the Script Editor dictionary?

1. Run Script Editor.
2. From the Script Editor menu bar, choose File > Open Dictionary.
3. From the application list, select "Script Editor".
4. Click OK.
5. Search for "paragraph".

--
Send responses to the relevant news group rather than email to me.
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.

JR

 >> Stay informed about: Paragraph jumper 
Back to top
Login to vote
Jo_y

External


Since: Jun 22, 2008
Posts: 30



(Msg. 3) Posted: Fri Nov 21, 2008 1:51 pm
Post subject: Re: Paragraph jumper [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> Probably. What do you mean by "jump to", exactly?
>
> Have you looked at the Script Editor dictionary?

Hello, i understand that my post was not clear and complete, hm. What
i want to do is to scroll fisically to one desired paragraph of the
front document of application "Script Editor" by typing in the
specific paragraph in my script dialog .
i'll show you the code:

--Paragaph JUMPER

tell application "Script Editor"
set ask_para to the text returned of (display dialog "Jump to
paragraph " default answer "12")
--or 0.5= middle of the document (for later)to calculate in %
set cc to count paragraphs of document 2
set y to contents of (paragraph 12 of document 2 as text)
-- added whitespaces does not cause the jump to the desired
paragraph. Sob
end tell
 >> Stay informed about: Paragraph jumper 
Back to top
Login to vote
Jolly Roger

External


Since: Sep 09, 2006
Posts: 3131



(Msg. 4) Posted: Fri Nov 21, 2008 6:54 pm
Post subject: Re: Paragraph jumper [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
Jo_y wrote:

> > Probably. What do you mean by "jump to", exactly?
> >
> > Have you looked at the Script Editor dictionary?
>
> Hello, i understand that my post was not clear and complete, hm. What
> i want to do is to scroll fisically to one desired paragraph of the
> front document of application "Script Editor" by typing in the
> specific paragraph in my script dialog .
> i'll show you the code:
>
> --Paragaph JUMPER
>
> tell application "Script Editor"
> set ask_para to the text returned of (display dialog "Jump to
> paragraph " default answer "12")
> --or 0.5= middle of the document (for later)to calculate in %
> set cc to count paragraphs of document 2
> set y to contents of (paragraph 12 of document 2 as text)
> -- added whitespaces does not cause the jump to the desired
> paragraph. Sob
> end tell

Why would you want to do that?

--
Send responses to the relevant news group rather than email to me.
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.

JR
 >> Stay informed about: Paragraph jumper 
Back to top
Login to vote
Jo_y

External


Since: Jun 22, 2008
Posts: 30



(Msg. 5) Posted: Sat Nov 22, 2008 10:05 am
Post subject: Re: Paragraph jumper [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> Why would you want to do that?

Hello,
i'll try to explain:
if i'm on top or elsewhere in my script -document, perhaps 100
paragraphs long, and i'll go back 30 paragraphs or more (up or down,
its the same) for controlling variables and so forth, then turns it
util to me to jump, fisically speaking- also to scroll- to the desired
paragraph using a script instead doing it manually.

It happens relatively often that i would go to a specific paragraph,
and scrolling to the right paragraph is really annoying, because too
imprecise. A script can do it for me, faster and better, the "Jump".
Any ideas how to solve this dilemma?
 >> Stay informed about: Paragraph jumper 
Back to top
Login to vote
Jo_y

External


Since: Jun 22, 2008
Posts: 30



(Msg. 6) Posted: Sat Nov 22, 2008 11:55 am
Post subject: Re: Paragraph jumper [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thats'it, Michelle. I've never used this panels, because 4 years ago
(where i've bought my fist Mac) there was still no reason for me to
using this pane panel.
(Handler are a flexibility where i've learnd in a second moment)
thanks to Roger for the support too.Cheers!
 >> Stay informed about: Paragraph jumper 
Back to top
Login to vote
Jolly Roger

External


Since: Sep 09, 2006
Posts: 3131



(Msg. 7) Posted: Sat Nov 22, 2008 12:33 pm
Post subject: Re: Paragraph jumper [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
Jo_y wrote:

> > Why would you want to do that?
>
> Hello,
> i'll try to explain:
> if i'm on top or elsewhere in my script -document, perhaps 100
> paragraphs long, and i'll go back 30 paragraphs or more (up or down,
> its the same) for controlling variables and so forth, then turns it
> util to me to jump, fisically speaking- also to scroll- to the desired
> paragraph using a script instead doing it manually.
>
> It happens relatively often that i would go to a specific paragraph,
> and scrolling to the right paragraph is really annoying, because too
> imprecise. A script can do it for me, faster and better, the "Jump".
> Any ideas how to solve this dilemma?

Most of my scripts are chunked into subroutines (called "handlers" in
AppleScript terminology). So it's rare for me to create huge, sprawling
blocks of code that span many pages. When I need to find something, it's
usually easiest just to jump to the particular handler that contains the
code I'm looking for. So I just search for the name of the handler
handler in question, which scrolls to it.

--
Send responses to the relevant news group rather than email to me.
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.

JR
 >> Stay informed about: Paragraph jumper 
Back to top
Login to vote
Michelle Steiner

External


Since: Jul 15, 2003
Posts: 4218



(Msg. 8) Posted: Sat Nov 22, 2008 12:33 pm
Post subject: Re: Paragraph jumper [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

Back to top
Login to vote
Jolly Roger

External


Since: Sep 09, 2006
Posts: 3131



(Msg. 9) Posted: Sat Nov 22, 2008 4:48 pm
Post subject: Re: Paragraph jumper [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
Michelle Steiner wrote:

> In article ,
> Jolly Roger wrote:
>
> > Most of my scripts are chunked into subroutines (called "handlers" in
> > AppleScript terminology). So it's rare for me to create huge,
> > sprawling blocks of code that span many pages. When I need to find
> > something, it's usually easiest just to jump to the particular
> > handler that contains the code I'm looking for. So I just search for
> > the name of the handler handler in question, which scrolls to it.
>
> You don't have to search. Just below the tool bar, you should see a
> group of one-line panes. With nothing selected in the script,the second
> pane (from the left) says "<No selected element>" (without the quotes,
> of course) with scroll arrows at the right. Clicking on that pane pops
> up a menu listing all the handlers in the script. Choose one, and you
> select the name of that handler in the script.
>
> If the insertion cursor is anywhere within a handler, the name of that
> handler is displayed instead of "<No selected element>" in the pane.
>
> You can see a picture of what I mean at
>
> <http://members.cox.net/michelle10042002/pictures/Editor.png>

Yep - I use that as well.

--
Send responses to the relevant news group rather than email to me.
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.

JR
 >> Stay informed about: Paragraph jumper 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Scripting Icons on Desktop (Panther) - Hi, new to OSX and want to reproduce a script I had for OS9 that moved all icons on desktop into several rows center-right of screen then re-positioned them in specific places around the screen - any left in the center were obviously new..

URL / Webloc drop - Does anyone have any pointers or sample code to handle the drop of a URL or "webloc" from something like Safari on to an Applescript application? I'm not having too much luck getting this working. Many thanks. -- rik

echo "blah" >> file.txt - how to do this with AppleScript? - Hi, I have a little AppleScript which calls shell commands to create a text file and append strings to it: ***** -- set variables set filepath to "'/Users/claus/the testfile.txt'" set line1 to "Line 1" set line2 to "Line 2&quot...

Delete all items of a specific folder - Hi, Beginner?s question: I want to delete all items inside a specific folder. However, the following attempt does not work. Where is the problem? delete every item of "claus:Library:Xchange:iPod:Aufgaben:" Greetings, Claus

Drag and Drop applet for UNIX Diction and Style? - I was wondering if there exists, (or anyone would take it on as a coding project, a drag and drop applet that would save a Style and/or Diction report- a readability score more or less, from a plain text file dropped upon this. This may very well alread...
   Macintosh computer (Home) -> Apple Scripts All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]