Jump to content

Automatize script in macOS Terminal


This topic is 1586 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a couple of scripts that do things in macOS Terminal via an AppleScript. It may look like this:

Perform AppleScript [ Native AppleScript: tell application "Terminal"
do shell script "cd /Users/admin/Desktop/Exportdata; curl -T Script1.txt -u filemaker:pass123 ftp://ftp.apple.com/" 
end tell ]

Problem: I don't get any information if this work or not.

Is there any way to see the command actual taking place? I added an "Activate" after the "tell" line, but that didn't help. 

As it is now, I do the scripts manually, just to maintain the control of what's happening, but that seems awfully old and not so effective. I would like to automatize this, but still be able to open the terminal window and see that the scripts has been run.

Does anybody know any way of doing this?

Tia,

Andreas

Link to comment
Share on other sites

3 hours ago, carlsson said:

Is there any way to see the command actual taking place? I added an "Activate" after the "tell" line, but that didn't help. 

Try doing:

do script "Your script"

instead of:

do shell script "Your script"

 

Although I believe the preferable method would be to do (directly in Filemaker, not through the Terminal):

set myResult to do shell script "Your script" 

 then do something with the result - e.g. set a field to it or show it in a dialog.

 

  • Like 1
Link to comment
Share on other sites

This topic is 1586 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.