Sunday, April 18, 2021
  • Index
  •  » Automator
  •  » Trouble implementing solution posted elsewhere on this forum...

#1 2021-03-04 09:20:40 am

dirodaman
Member
Registered: 2021-02-15
Posts: 1

Trouble implementing solution posted elsewhere on this forum...

Hello, I have a functioning Automator Quick Action that creates a dated text file in whatever current directory I'm in. I just want to Automator to append numbers if a file name already exists, but I'm unsure how to do so using a solution posted elsewhere on this forum. Here's the script I have working:

Applescript:


set myName to date_format((current date) as string)

to date_format(old_date) -- Old_date is text, not a date.
   set {year:y, month:m, day:d} to date old_date
   tell (y * 10000 + m * 100 + d) as string to text 1 thru 4 & "-" & text 5 thru 6 & "-" & text 7 thru 8 & "_Note_.txt"
end date_format

tell application "Finder"
   set txt to make new file at (the target of the front window) as alias with properties {name:myName as string}
   select txt
end tell

I am trying to implement DJ Bazzie Wazzie's solution posted here:
https://macscripter.net/viewtopic.php?id=36082

but I am stuck on the line:

Applescript:

set existingFiles to list folder fileLocation with invisibles

... I'm not sure what to use as fileLocation if I want the service to operate in any directory on my computer? Is his solution not the way to go for what I have already? I appreciate any help.

Offline

 
  • Index
  •  » Automator
  •  » Trouble implementing solution posted elsewhere on this forum...

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)