A true AppleScript user...

A true AppleScript user should have a ‘snippet’ for macscripter.net posts.
So why not test the script and do some wonderful posts. :wink:

You have to remove the underscore _ from applescript, it was little difficult to post without it. :slight_smile:

tell application "Script Editor"
	tell front document
		set the selectedText to contents of selection
		
		if the selectedText is "" then
			set scriptText to "You need to select Text"
		else
			set the scriptText to ""
			set the scriptText to "[__applescript__]"
			set the scriptText to the scriptText & the selectedText
			set the scriptText to the scriptText & "[__/applescript__]"
		end if
	end tell
end tell


set the clipboard to scriptText

Fredrik71. I tested your script and it works well. I was confused by those underscores until I carefully read your post. :slight_smile:

Forum members often point out that it’s best not to include anything in a tell statement that not’s required. So, although a very-minor point, perhaps the following:

tell application "Script Editor"
	tell front document
		set the selectedText to contents of selection
	end tell
end tell

if the selectedText is "" then
	set scriptText to "You need to select Text"
else
	set the scriptText to ""
	set the scriptText to "[__applescript__]"
	set the scriptText to the scriptText & the selectedText
	set the scriptText to the scriptText & "[__/applescript__]"
end if

set the clipboard to scriptText

Thanks, Peavine you are right. (no excuse but maybe to much GUI Scripting for me.)

I’m working on a handler for Numbers in GUI Scripting, the function Gridlines is not in the
dictionary. And it’s not always clear because there is so much missing value in Apple products. :slight_smile:

I doing table in Numbers to position a box to produce picture sheets on A4 format.

I got the idea, after my Pixel Art Script, and if I have a good structor I also think I could include
random positions and rotation. You know, 1 picture say more and 1000 words. So automate
Keynote, Numbers with picture’s could be fun instead of the normal things we are used to find.