Automator Workflow - Open a file

I would like to create an Automator workflow that opens an existing *.bat file when a new *.txt file is saved to a folder.


I started it with a folder action and selected the specific folder that the txt file will be saved to. This is the same folder within which the bat file exists.


The first workflow step I have is to Filter for the specific file that will be added. I chose name contains for the logical and entered the name of the file "Naviance_Student".


I am then thinking I need to add a "Run Shell Script" step to my workflow that will simply open the bat file but I am very NOVICE at all of this and I'm not sure what to enter in the arguments part of this.

MacBook Pro 15″, macOS 11.1

Posted on Feb 20, 2024 9:16 AM

Reply
3 replies

Feb 20, 2024 9:33 AM in response to kvenett

You’ve told us how you think your proposed solution can or will work, but not provided the background and general requirements your proposed app is seeking to provide here. There might be an alternative approach, or there might be an existing solution. And FWIW, “bat” batch files are usually a Microsoft Windows thing, so I’m unclear what’s happening there.


I’d expect to use a folder action here, then probably enough AppleScript to launch a shell script.


Mac Automation Scripting Guide: Watching Folders

Folder Actions Reference


Here are some other options which don’t use AppleScript:


https://apple.stackexchange.com/questions/40705/monitor-a-folder-for-changes-and-run-a-command-when-a-change-is-detected


Feb 20, 2024 10:01 AM in response to MrHoffman

Thank you so much for these resources! I apologize for not providing enough information. Unfortunately I'm trying to accomplish a task that I have no business doing because I lack a significant amount of background knowledge.


The file I'm trying to run is named runDimport.bat. Without providing secure information here, the .bat file is a script that sends the txt file to our Naviance application site for import. It will execute that script when I double click on it. (Naviance is a student transcript/college application application we use in our district.)


I am just trying to automate the running of that .bat file when I drop a new import txt file in the folder.


I will take a look at these resources and see if I can find a simple solution.


Thank you again!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Automator Workflow - Open a file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.