Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.
delete chunk of container
delete
[menuItem
of] menu
delete
[menuItem
from] menu
delete
{button
| field
|part
} delete
command removes text from a container, menu items from a menu, menus from the menu bar, and buttons or fields from the current card or background. delete part
, deleteButton
or deleteField
is sent to the object that's being deleted. part
anywhere except on the current card. delete
to delete a line is not the same as putting empty
into the line: delete
removes the final return
character as well as the text, while putting empty
into the line just removes the text. delete item 3 of line 1 of field "Expenses"
delete line 5 of button "Text Holder"
put " this has a space" into theText
delete character 1 of theText
delete menu "File"
delete menu 2
delete second menu
delete menuItem "New" from menu "File"
delete menuItem 2 from menu 2
delete second menuItem from second menu
delete button 1
delete last card field
delete background button id 1234
delete last background part
on surpriseDelete
-- appropriate surprise with style
set the cantModify of this stack to true -- to easily restore the text
find string "ropriate surprise with sty"
wait 1 sec
delete the foundChunk
wait 1 sec
set cantModify of this stack to false
end surpriseDelete
ordinal
charactercharacter posInteger [to posInteger
]ordinal wordword posInteger
[to posInteger
]ordinal itemitem posInteger
[to posInteger
]ordinal lineline posInteger
[to posInteger
]first character
second item
middle line
character 1
char 1 to 10
word 3
item 5 to (the number of items of me)
line 1 to 10
char 1 to 10 of word 2 to 4 of ¬
line 3 to 6
A chunk combined with of
and a container is called a chunk expression. For example:
line 1 of card field "index"
myVariable
[the] selection
the Message box
btn 3
bg btn "Names"
card field 1
bkgnd field "Total"
menu 2
menu "Edit"
Additionally, you can refer to a button or field by its part number:card part 1
last background part
AppleScript DefinitionAn object that contains one or more other objects, known as elements of the container. In a reference, the container specifies where to find an object. You specify containers with the reserved words of
or in
.'s
) to specify containers. For example, infirst window's name
the container is first window
. The object it contains is a name property. menu text
menu posInteger
ordinal menu
For example: menu "File"
menu 2
second menu
partNumber
property.card
] part posInteger
[bg
] part posInteger ordinal
[card
] [bg] part
For example:card part 5
first card part
last background part
Commands
Version 0.7b1 (March 24, 2022)