applescript

AppleScript to Launch 1Password mini

。_饼干妹妹 提交于 2019-12-10 16:02:13
问题 I use 1Password to store my passwords, and fluid.app to create a few site-specific apps/browsers While 1Password integrates well with Chrome, Safari and other browsers, it doesn't play nicely with Fluid apps, which is where my troubles lie. I have therefore created a shortcut (with Keyboard Maestro ) to run an applescript to open the mini, when I am in Fluid apps. However, I can't seem to get the applescript to launch the mini. Here are my attempts: tell application "1Password mini" to launch

Using applescript I want to move every file within the folder to the root folder

自闭症网瘾萝莉.ら 提交于 2019-12-10 15:08:56
问题 I have been trying to make a script to move every file within a folder to the root folder to include every sub folder. I don't want to make a new folder just move it to the root folder. I want to be able to select the folder and then the action be completed on that specific folder only. The reason is for organization, my exact situation is I have over a TB of movies and there's files within folders within folders. I want all those files on the root folder so that I can organize them how I

How do you efficiently build a list within a handler in AppleScript?

和自甴很熟 提交于 2019-12-10 14:49:21
问题 AppleScript documentation suggests the following code to efficiently build a list: set bigList to {} set bigListRef to a reference to bigList set numItems to 100000 set t to (time of (current date)) --Start timing operations repeat with n from 1 to numItems copy n to the end of bigListRef end set total to (time of (current date)) - t --End timing Note the use of an explicit reference. This works fine at the top level of a script or within an explicit run handler, but if you run the same exact

How to fetch and parse an XML file using AppleScript?

痴心易碎 提交于 2019-12-10 13:33:18
问题 There's an XML file on some remote server (http://foo/bar.xml): <?xml version="1.0" encoding="UTF-8"?> <foo> bar </foo> How can I get the value "bar" using AppleScript? 回答1: Here's what I've done: set file_tgt to (POSIX path of (path to temporary items)) & "file.xml" do shell script "curl -L " & "http://url.com/file.xml" & " -o " & file_tgt tell application "System Events" set file_content to contents of XML file file_tgt tell file_content set my_value to value of XML element 1 end tell end

Send HTML Mail from Cocoa with Mail.app

瘦欲@ 提交于 2019-12-10 13:05:39
问题 I'm trying to send html email from Cocoa app, through Mail.app. I want to open new message in Mail.app, include subject, recipient and add HTML Body with links and other content. But can't find the way to do this. I already tried Scripting Bridge, but MailOutgoingMessage class doesn't have content type i can add content in plaintext. tried AppleScript, something like this: set htmlContent to read "/Path/index.html" set recipientList to {"mail@mail.com"} tell application "Mail" set newMessage

convert image to .icns file AppleScript Obj-C

做~自己de王妃 提交于 2019-12-10 12:23:49
问题 how can I convert a .png image to a .icns using applescript? Any help would be greatly appreciated. 回答1: Could you just use sips? sips -s format icns test.png -o test.icns It doesn't seem to support 1024 x 1024 images or create smaller versions though. 来源: https://stackoverflow.com/questions/11991645/convert-image-to-icns-file-applescript-obj-c

Applescript error while trying to move files with hazel

。_饼干妹妹 提交于 2019-12-10 12:22:10
问题 So,I have an applescript (bellow) wich is used to clean the name of a tv show episode, and move the episode to its right folder based on that. I use hazel to activate the script with the right file. In applescript editor, the script seems fine, but Hazel gives me an error on line 12. Here's the script: set theSample to theFile set a to RemoveListFromString(theSample, {"720p", "HDTV", "x264", "IMMERSE", "-", "E01"}) set b to RemoveListFromString(a, {"..."}) set c to RemoveListFromString(b, {".

Applescript New Folder Named By Date

泄露秘密 提交于 2019-12-10 12:04:30
问题 So I am new to applescript and I am trying to make an application that will make a new folder at the desktop that has the name of the current date and time. Every time I run it, there is and error and it reads, "Can’t make "11/8/13" into type number." Please help and thanks for your input and answers! tell application "Finder" set p to path to desktop set d to short date string of (current date) set t to time string of (current date) set FullDate to d + t make new folder at p with properties

Applescript open file with TextEdit and export them as pdf

别来无恙 提交于 2019-12-10 11:43:05
问题 This is my very first applescript. I use automator to launch the script as I drop new files to a folder (Folder action). In Automator I have 2 action: 1- Get Specified Finder Items 2- The Apple Script But I can't make it running. The script stops without warning after opening the files. Here is the script: on run {input, parameters} tell application "TextEdit" to activate repeat with theFile in input set theFilePath to theFile as alias tell application "TextEdit" to open theFilePath tell

using applescript to display Unix Exctable file

↘锁芯ラ 提交于 2019-12-10 11:23:33
问题 I want to use applescript to create a application to run a Unix Executable File. I would like the information from the Unix exe file to be displayed within applescript. Is this possible? 回答1: Try this: set aVariable to do shell script "fullPathToYourExecutable" display dialog aVariable 来源: https://stackoverflow.com/questions/15015172/using-applescript-to-display-unix-exctable-file