Skip to content

Instantly share code, notes, and snippets.

@mingsai
Created May 28, 2020 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingsai/9d7da9f95060955f839e09b968fb876d to your computer and use it in GitHub Desktop.
Save mingsai/9d7da9f95060955f839e09b968fb876d to your computer and use it in GitHub Desktop.
Applescript: Trim the last three characters from text input
on run {input, parameters}
set output to ((characters 1 thru -4 of (item 1 of input as string)) as string)
--set output to (item 1 of input as string)
(* Your script goes here *)
(* if output ends with ".js" then
set output to ((characters 1 thru -4 of output) as string)
--display dialog updated
end if
*)
--display dialog output
--replace_text(input, ".js", "")
return output
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment