Re: Applescript to upload file with Transmit
Re: Applescript to upload file with Transmit
- Subject: Re: Applescript to upload file with Transmit
- From: René Groot via AppleScript-Users <email@hidden>
- Date: Fri, 28 Feb 2020 23:43:01 +0000
Below is an applescript subrouting that uses shell script to put a file on an
sftp server. I used to work with Transmit, but at some point I had issues with
that app and explored using shell script and ended up with this. Works fine for
my setup.
on sftp()
set sftpScript to "#!/bin/bash
HOST=sftp.xs4all.nl
USER=username
PASS=password
PROMPT=sftp\\>
expect -c \"
spawn sftp $USER@$HOST
expect \\\"password:\\\"
send \\\"$PASS\\r\\\"
expect \\\"$PROMPT\\\"
send \\\"put /Users/path/file.html WWW/path\\r\\\"
expect \\\"$PROMPT\\\"
send \\\"exit\\r\\\"
\"
"
do shell script "sh -c " & quoted form of sftpScript
end sftp
> On 27 Feb 2020, at 21:44, David Crowe <email@hidden> wrote:
>
> Ren;
>
> I’d certainly like to see some of your sftp commands. Not looking forwards to
> replacing 20 or 30 or 40 little scriplets that use Fetch though!
>
> - David Crowe
>
>
>
>> Message: 2
>> Date: Wed, 26 Feb 2020 23:07:56 +0000
>> From: Ren? Groot <email@hidden <mailto:email@hidden>>
>> To: email@hidden
>> <mailto:email@hidden>
>> Subject: Re: Applescript to upload file with Transmit
>> Message-ID: <email@hidden
>> <email@hidden">mailto:email@hidden>>
>> Content-Type: text/plain; charset=utf-8
>>
>> I have obtained very good results using shell script with sftp in a spawn
>> command. This is basically a series of commands that react to the responses
>> an sftp server gives. If you want to go that way I can send or post my
>> example.
>>
>> Cheers, Ren? Groot
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden