I want to be able to create a new document in BBedit.
Copy the first word
save it a folder of choice adding the word copied word abd space and “full” before the default".-txt"
Delay for 5
Createa new doc in BBedit
copy the first word again in the new doc
save it a folder of choice adding the word copied word abd space and “msg” before the default".-txt"
the delay is useful to find what I need to copy
By definition, a new document would be empty, therefore the ‘first word’ doesn’t exist and the rest of the script is doomed to fail.
That said, assuming you have some magic solution to that one:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
-- I want to be able to create a new document in BBedit.
-- I want to be able to create a new document in BBedit.
tell application "BBEdit"
set newDoc to make new document
-- Copy the first word
set theWord to word 1 of newDoc
-- save it a folder of choice adding the word copied word abd space and “full” before the default".-txt"
-- substitute any path you like here
save newDoc to file ("Macintosh HD:Users:username:Documents:" & theWord & " full.txt")
-- Delay for 5 seconds
delay 5
-- create a new document in BBedit.
set newDoc to make new document
-- Copy the first word
set theWord to word 1 of newDoc
-- save it a folder of choice adding the word copied word abd space and “msg” before the default".-txt"
save newDoc to file ("Macintosh HD:Users:username:Documents:" & theWord & " msg.txt")
end tell