automator

How do I use the current folder name without a path as a variable in automator in Mac?

倖福魔咒の 提交于 2019-12-03 12:30:51
I am using Mac OSX 10.8.3. I have a workflow in Automator set up that is as follows: Ask for Finder Items Get Folder Contents Make Sequential Move Finder Items The purpose of the workflow is to automate renaming a bunch of photos that I have saved in folders then move them to an new folder. I want to grab the foldername and stick it in a variable and use that variable in the "new name box" in the Make Sequential section of the work flow (see attached) image. How do I grab just the folder name and assign it to a variable. My example has a variable called "FolderName" Here is a screenshot

How to create an Apple Script that runs a Terminal command?

老子叫甜甜 提交于 2019-12-03 12:17:25
I want to create an apple script that opens terminal and summons this command : sudo killall coreaudiod How is this possible? do shell script "sudo killall coreaudiod" with administrator privileges the user gets asked for the password then 来源: https://stackoverflow.com/questions/19101518/how-to-create-an-apple-script-that-runs-a-terminal-command

How to access drop down in application using applescript?

百般思念 提交于 2019-12-03 10:20:54
问题 I'm trying to tell applescript to open the app, Application Loader, and choose from the drop down list that's in the window. The item that should be chosen will always be the very first item. How do i do this? Thanks in advance. 回答1: Wow I finally got it working! I pretty much got mad at my script so I just put a random ASCII number and it magically worked. I got pretty happy aha :) activate application "Application Loader" tell application "System Events" tell process "Application Loader"

MacOS, how to delete unused service item in Keyboard Shortcuts

两盒软妹~` 提交于 2019-12-03 09:38:45
问题 I'm a newbie to Mac OS and learning with Automator, I found it useful but not quite controllable. I made a shortcut in services but I don't know how to delete it. The item highlighted is what I want to delete. I think I should do it with Automator but I don't find out how. Any help will be appreciated. 回答1: crtl + mouse click on the service to get a context menu for the service. Select Show in Finder. This will take you to the service file by opening a new finder window and selecting it. You

How to access drop down in application using applescript?

允我心安 提交于 2019-12-03 00:50:15
I'm trying to tell applescript to open the app, Application Loader, and choose from the drop down list that's in the window. The item that should be chosen will always be the very first item. How do i do this? Thanks in advance. Wow I finally got it working! I pretty much got mad at my script so I just put a random ASCII number and it magically worked. I got pretty happy aha :) activate application "Application Loader" tell application "System Events" tell process "Application Loader" tell the first combo box of window 1 delay 3 keystroke (ASCII character 30) keystroke (ASCII character 12)

Mac Automator (OS 10.7) not reading Ruby 1.9.3?

痞子三分冷 提交于 2019-12-02 18:52:00
问题 I have some Ruby code in a .rb file that I am trying to run with Automator as opposed to the Command Line. Here is a sample of the code (filename is "filelines_revise.rb"): lines = IO.readlines('filelines_before_CAP.txt').map do |line| array = line.split.each { |i| i.capitalize! } if array.include?("Ws") array.delete("Ws") array[-1,0] = "Ws" end if array.include?("Es") array.delete("Es") array[-1,0] = "Es" end array_2 = array.join(" ") array_2.gsub(/ Ws /, ", west side") .gsub(/ ES /, ", east

Setting NSUserAutomatorTask variables without requiring Automator Workflows to declare that variable

可紊 提交于 2019-12-01 17:05:02
I'm using NSUserAutomatorTask to launch a .workflow file, created via the Automator app in macOS 10.13. I'm passing variables to the workflow via the variables property: https://developer.apple.com/documentation/foundation/nsuserautomatortask/1418099-variables The parent app is sandboxed. The script is located in the .applicationScriptsDirectory and runs successfully when variables are not set, or when the same variables are set from the app and declared in the workflow. if let workflow = try? NSUserAutomatorTask(url: url) { workflow.variables = ["randomVariable": "value"] // NOTE workflow

Setting NSUserAutomatorTask variables without requiring Automator Workflows to declare that variable

安稳与你 提交于 2019-12-01 17:00:29
问题 I'm using NSUserAutomatorTask to launch a .workflow file, created via the Automator app in macOS 10.13. I'm passing variables to the workflow via the variables property: https://developer.apple.com/documentation/foundation/nsuserautomatortask/1418099-variables The parent app is sandboxed. The script is located in the .applicationScriptsDirectory and runs successfully when variables are not set, or when the same variables are set from the app and declared in the workflow. if let workflow = try

Applescript: Create folders/subfolders and move multiple files

本小妞迷上赌 提交于 2019-12-01 14:11:24
I have an Applescript question that is much more complex than I can construct. I have been searching for the past couple of days, and I cannot find any script like this, nor can I find enough information to piece one together with my limited knowledge. I have multiple files with structured names. Each file has the following name structure: ttu_collectionname_000001.pdf ttu_collectionname_000002.mp3 ttu_collectionname_000003.pdf ... etc. (Each of these files are of varying file types.) There is also a csv metadata file associated with each of the original files. ttu_collectionname_000001.csv

Read a text file with Automator.app line by line

戏子无情 提交于 2019-12-01 10:43:28
I'm a novice at coding so please be patient with me. I've created a Workflow with Automator (OSX) which works fine. The only issue I have is that I want it to run on a number of inputs (that is as a batch). I've inserted the Loop action but the problem I'm having is about changing the initial input each time. I would like to use an applescript to automate the insertion of the initial input each time. I have a TXT file with URLs. With an apple script, I'd like to copy a URL (or a line of text) to clipboard. In the next iteration I'd like to copy the next URL (or line of text). Can anyone help?