spacevim/bundle/neosnippet-snippets/neosnippets/applescript.snip
JIe 2bb7059579
Some checks failed
Detach Plugins / check (FlyGrep.vim) (push) Has been cancelled
Detach Plugins / check (GitHub.vim) (push) Has been cancelled
Detach Plugins / check (JavaUnit.vim) (push) Has been cancelled
Detach Plugins / check (SourceCounter.vim) (push) Has been cancelled
Detach Plugins / check (cpicker.nvim) (push) Has been cancelled
Detach Plugins / check (dein-ui.vim) (push) Has been cancelled
Detach Plugins / check (git.vim) (push) Has been cancelled
Detach Plugins / check (iedit.vim) (push) Has been cancelled
Detach Plugins / check (scrollbar.vim) (push) Has been cancelled
Detach Plugins / check (vim-chat) (push) Has been cancelled
Detach Plugins / check (vim-cheat) (push) Has been cancelled
Detach Plugins / check (vim-todo) (push) Has been cancelled
Detach Plugins / check (xmake.vim) (push) Has been cancelled
test / Linux (nvim, nightly) (push) Has been cancelled
test / Linux (nvim, v0.3.8) (push) Has been cancelled
test / Linux (nvim, v0.4.0) (push) Has been cancelled
test / Linux (nvim, v0.4.2) (push) Has been cancelled
test / Linux (nvim, v0.4.3) (push) Has been cancelled
test / Linux (nvim, v0.4.4) (push) Has been cancelled
test / Linux (nvim, v0.5.0) (push) Has been cancelled
test / Linux (nvim, v0.5.1) (push) Has been cancelled
test / Linux (nvim, v0.6.0) (push) Has been cancelled
test / Linux (nvim, v0.6.1) (push) Has been cancelled
test / Linux (nvim, v0.7.0) (push) Has been cancelled
test / Linux (nvim, v0.7.2) (push) Has been cancelled
test / Linux (nvim, v0.8.0) (push) Has been cancelled
test / Linux (nvim, v0.8.1) (push) Has been cancelled
test / Linux (nvim, v0.8.2) (push) Has been cancelled
test / Linux (nvim, v0.8.3) (push) Has been cancelled
test / Linux (nvim, v0.9.0) (push) Has been cancelled
test / Linux (nvim, v0.9.1) (push) Has been cancelled
test / Linux (true, vim, v7.4.052) (push) Has been cancelled
test / Linux (true, vim, v7.4.1689) (push) Has been cancelled
test / Linux (true, vim, v7.4.629) (push) Has been cancelled
test / Linux (true, vim, v8.0.0027) (push) Has been cancelled
test / Linux (true, vim, v8.0.0183) (push) Has been cancelled
test / Linux (vim, nightly) (push) Has been cancelled
test / Linux (vim, v8.0.0184) (push) Has been cancelled
test / Linux (vim, v8.0.1453) (push) Has been cancelled
test / Linux (vim, v8.1.2269) (push) Has been cancelled
test / Linux (vim, v8.2.2434) (push) Has been cancelled
test / Linux (vim, v8.2.3995) (push) Has been cancelled
test / Windows (nvim, nightly) (push) Has been cancelled
test / Windows (nvim, v0.3.8) (push) Has been cancelled
test / Windows (nvim, v0.4.2) (push) Has been cancelled
test / Windows (nvim, v0.4.3) (push) Has been cancelled
test / Windows (nvim, v0.4.4) (push) Has been cancelled
test / Windows (nvim, v0.5.0) (push) Has been cancelled
test / Windows (nvim, v0.5.1) (push) Has been cancelled
test / Windows (nvim, v0.6.0) (push) Has been cancelled
test / Windows (nvim, v0.6.1) (push) Has been cancelled
test / Windows (nvim, v0.7.0) (push) Has been cancelled
test / Windows (nvim, v0.7.2) (push) Has been cancelled
test / Windows (nvim, v0.8.0) (push) Has been cancelled
test / Windows (nvim, v0.8.1) (push) Has been cancelled
test / Windows (nvim, v0.8.2) (push) Has been cancelled
test / Windows (nvim, v0.8.3) (push) Has been cancelled
test / Windows (nvim, v0.9.0) (push) Has been cancelled
test / Windows (nvim, v0.9.1) (push) Has been cancelled
test / Windows (vim, nightly) (push) Has been cancelled
test / Windows (vim, v7.4.1185) (push) Has been cancelled
test / Windows (vim, v7.4.1689) (push) Has been cancelled
test / Windows (vim, v8.0.0027) (push) Has been cancelled
test / Windows (vim, v8.0.1453) (push) Has been cancelled
test / Windows (vim, v8.1.2269) (push) Has been cancelled
test / Windows (vim, v8.2.2434) (push) Has been cancelled
test / Windows (vim, v8.2.3995) (push) Has been cancelled
docker / docker (push) Has been cancelled
mirror / check (coding) (push) Has been cancelled
mirror / check (gitee) (push) Has been cancelled
mirror / check (gitlab) (push) Has been cancelled
init
2024-08-21 14:17:26 +08:00

186 lines
3.7 KiB
Plaintext

snippet script
script ${1:#:new_object}
on run
${2:TARGET}
end run
end script
snippet on
on ${1:#:functionName}(${2:#:arguments})
${3:TARGET}
end ${1}
snippet tell
tell ${1:#:app}
${0:TARGET}
end tell
snippet terms
using terms from ${1:#:app}
${0:TARGET}
end using terms from
snippet if
if ${1:true} then
${0:TARGET}
end if
snippet rept
abbr rep
repeat ${1} times}
${0:TARGET}
end repeat
snippet repwh
abbr rep
repeat while ${1:#:condition}
${0:TARGET}
end repeat
snippet repwi
abbr rep
repeat with ${1} in ${2}
${0:TARGET}
end repeat
snippet try
try
${0:TARGET}
on error
-- error handling
end try
snippet timeout
with timeout ${1:#:number} seconds
${0:TARGET}
end timeout
snippet con
considering ${1:#:case}
${0:TARGET}
end considering
snippet ign
ignoring ${1:#:application responses}
${0:TARGET}
end ignoring
snippet shell
${1:#:set shell_stdout to }do shell script ${3:"${2:#script}"}
without altering line endings
${0}
snippet delim
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"${1:,}"}
${0:#:TARGET}
set AppleScript's text item delimiters to oldDelims
snippet parent
prop parent : app "${1}"
snippet alert
display alert "${1:#:alert text}"
${2:#:message} "${3:#:message text}"
${4:#:as warning}
snippet dialog_OK
abbr dialog
display dialog "${1:#:text}"
${2:#:with icon} ${3:1}
buttons {"${4:OK}"} default button 1
snippet dialog_OK/Cancel
abbr dialog
display dialog "${1:#:text}"
${2:#:with icon}
buttons {"${3:Cancel}", "${4:OK}"}
default button "${4}"
set button_pressed to button returned of result
if button_pressed is "${4}" then
${5:#:TARGET}
else
-- action for cancel button goes here
end if
snippet dialog_OK/Cancel/Other
abbr dialog
display dialog "${1:#:text}"
${2:#:with icon}
buttons {"${3:Cancel}", "${4:Other Choice}", "${5:OK}"}
default button "${5}"
set button_pressed to button returned of result
if button_pressed is "${5}" then
${6:TARGET}
else if button_pressed is "${3}" then
-- action for cancel button goes here
else
-- action for other button goes here
end if
snippet dialog_TextFierld
abbr dialog
set the_result to display dialog "${1:#:text}"
default answer "${2:#:type here}"
${3:#:with icon}
buttons {"${4:Cancel}", "${5:OK}"}
default button "${5}"
set button_pressed to button returned of the_result
set text_typed to text returned of the_result
if button_pressed is "${5}" then
${6:#:TARGET}
else
-- action for cancel button goes here
end if
snippet choose_Applications
abbr choose
${1:#:set the_application to }choose application with prompt "${2:#:Choose an application:}"${3:#:with multiple selections allowed}
snippet choose_Files
abbr choose
${1:#:set the_file to }choose file with prompt "${2:#:Pick a file:}"
${3:#:default location path to home folder}
${4:#:with invisibles}
${5:#:with multiple selections allowed}
${6:#:with showing package contents}
snippet choose_Folders
abbr choose
${1:#:set the_folder to }choose folder with prompt "${2:#:Pick a folder:}"
${3:#:default location path to home folder}
${4:#:with invisibles}
${5:#:with multiple selections allowed}
${6:#:with showing package contents}
${0}
snippet choose_NewFile
abbr choose
${1:#:set the_filename to }choose file name with prompt "${2:#:Name this file:}"
default name "${3:untitled}" default location ${4:#:path to home folder}
snippet choose_URL
abbr choose
${1:#:set the_url to }choose URL showing ${2:Web} servers with editable URL
snippet choose_Color
abbr choose
${1:#:set the_color to }choose color default color ${2:{65536, 65536, 65536\}}
snippet choose_ItemFromList
abbr choose
set the_choice to choose from list ${1}"\}}