Author Topic: applescript collection  (Read 1288 times)

tellsapfel

  • Jr. Member
  • Posts: 5
applescript collection
« on: January 17, 2014, 10:23:07 AM »
Hi,

perhaps we can share some useful scripts. Here is one for autosyncing local files with the server.

Automator -> new Service -> Run Apple Script -> add:
on run {input, parameters}
   
   tell application "System Events"
      keystroke "s" using command down
   end tell
-- tells the app press cmd+s
   
   tell application "Yummy FTP"
      
      using connection "nameofyourconnection" synchronize "Update Server"
   end tell
-- change "nameofyourconnection" with the bookmarked name of your connection
   
   return input
end run



->Save

Go to System Preferences -> Keyboard -> Shortcuts -> Services -> Assign Shortcut to the name you saved in automator

Hope this helps
« Last Edit: January 17, 2014, 03:46:53 PM by tellsapfel »

JD

  • Administrator
  • FTP Guru
  • Posts: 2513
Re: applescript collection
« Reply #1 on: January 17, 2014, 11:26:40 AM »
That's really great! :)

I can see more or less what it does, but it might be useful to add a description of the code?

For what it's worth, there are some example scripts included in the Yummy FTP Extras, available from the Help menu in the regular version, or from the link below:

http://www.yummysoftware.com/YummyFTPExtras.dmg.zip

I haven't updated it in a while, but I have other useful things I could add now so I will update it soon.

tellsapfel

  • Jr. Member
  • Posts: 5
Re: applescript collection
« Reply #2 on: January 17, 2014, 03:37:02 PM »
it seems your first script probably does the same with a different approach.

"This AppleScript allows you to work on a local copy of your web site files and then automatically send them to your FTP server each time you Save the changes."

The downside with mine is that the the local /ftp folder with the file to be synced have to be open. I use TextMate as a editor, but can´t think of a better solution

p.s

great app

tellsapfel

  • Jr. Member
  • Posts: 5
Re: applescript collection
« Reply #3 on: January 24, 2014, 10:39:18 AM »
any idea how i can tell yummy ftp the path to sync when saving a file from textmate with the above apple script?

At the moment i always have to change folder for the sync to work. So this would help.

thanks

JD

  • Administrator
  • FTP Guru
  • Posts: 2513
Re: applescript collection
« Reply #4 on: January 24, 2014, 12:48:22 PM »
Just checking…

You know Yummy has built-in support for remote editing with TextMate and other apps?

… but to answer your question:

The AppleScript to change directory is :

using connection "yourbookmarknamehere" list remote folder "fullpathhere"

or

using connection "yourbookmakrnamehere" lost local folder "fullpathhere"

tellsapfel

  • Jr. Member
  • Posts: 5
Re: applescript collection
« Reply #5 on: January 25, 2014, 01:45:33 PM »
yes.

Thanks, but that doesn´t achieve it. For example: I´m  in local folder x and open a file in it. Then i change the local folder x to folder y. Now when i´d like to sync the first file i opened i would have to go back to folder x to make sync work. But i would like to transfer the file to the server independently.  Kinda like auto route.

Which by the way seems to have a bug. I´ve set it up and it works, but there seems to be a second auto route which uses a wrong path at the same time and fails with SSH2_FX_NO_SUCH_FILE


JD

  • Administrator
  • FTP Guru
  • Posts: 2513
Re: applescript collection
« Reply #6 on: January 27, 2014, 07:05:27 AM »
Ah, I see what you mean. In lieu of a 'saved sync' feature, which I'd like to add at some point, I think you'll need to set up a separate Bookmark to do the syncing from. Work/browse from one and sync from the other.

The Auto-Route feature is recursive, in that it will find all matches for the local path. If you don't want this behaviour then turn off the 'Recursive Auto-Route' option in the Transfers panel of the Preferences.

raguay

  • Newbie
  • Posts: 1
Re: applescript collection
« Reply #7 on: October 28, 2014, 10:20:30 AM »
That's really great! :)

I can see more or less what it does, but it might be useful to add a description of the code?

For what it's worth, there are some example scripts included in the Yummy FTP Extras, available from the Help menu in the regular version, or from the link below:

http://www.yummysoftware.com/YummyFTPExtras.dmg.zip

I haven't updated it in a while, but I have other useful things I could add now so I will update it soon.


I can not find this file "YummyFTPExtras.dmg.zip" anywhere. Is it still avaliable?


JD

  • Administrator
  • FTP Guru
  • Posts: 2513
Re: applescript collection
« Reply #8 on: October 28, 2014, 11:59:16 AM »
I have placed the following file online which contains the example Apple Scripts :)

http://www.yummysoftware.com/downloads/ExampleAppleScripts.zip