applescript

How to wait for webpage to fully load before proceeding script?

泪湿孤枕 提交于 2019-12-06 08:23:55
问题 How do you wait for a webpage to fully load before proceeding the script? I know you can use delay 4 if you would want it to wait 4 seconds but this is not safe enough. In VBA you have a simple code that always works and it goes like this: Dim x As String x = "https://na6.salesforce.com/p/attach/NoteAttach?pid=" & Range("T34").Value & "&parentname=" & Range("T35").Value & "&retURL=%2F0018000000sKz8K%3Fpb0%3Dtrue" Set IE = CreateObject("InternetExplorer.Application") IE.Navigate (x) IE.Visible

What are error -10004 and error -10000 in Applescript

徘徊边缘 提交于 2019-12-06 08:11:24
问题 I have an Applescript that is working on my computer, but not on my colleague's. I get two errors when manipulating paths: -10004 and -10000 . I have an idea on how to solve this, but first I'd like to understand those error codes. Here is the script (I removed useless part, the full version is on github): -- export all layers to image files -- Settings property exportFileExtension : "png" property ADD_CANVAS_NUMBER : true -- End of Settings on file_exists(FileOrFolderToCheckString) try alias

FileDialog in Word 2011 VBA

孤街浪徒 提交于 2019-12-06 07:52:21
问题 I'm hoping for a bit of a sanity check. I'm adapting a Word add-in (written in VBA for Word 2010) for Mac, specifically, at this point, Word 2011. I'm aware of many of the differences, but one that I haven't been able to find much documentation on is the apparent lack of FileDialog. The closest I've come to an answer is here: http://www.rondebruin.nl/mac.htm where the author uses Application.GetOpenFilename. That method doesn't seem to exist for Word, though (the focus of that site is Excel).

How to suppress / automatically dismiss error dialog in AppleScript

落花浮王杯 提交于 2019-12-06 07:49:44
问题 I have background process running as the logged on user that frequently tries to mount an AFP share to backup some data. If the share cannot be mounted this should just be ignored. In my script (bash, actually) I am mounting the share via an AppleScript mount volume snippet. In contrast to the mount or mount_afp commands, this appears to be the only way to automatically authenticate the user at the respective server with credentials from the Kerberos ticket or the user's keychain. In

Get variable from another script

拈花ヽ惹草 提交于 2019-12-06 07:49:36
问题 In applescript can you use a variable that was defined in another script? I think you would have something like: set test to (load script "/tmp/a.scpt") But how would you pick a specific variable? 回答1: You could use property variables in your external script e.g, a.scpt: property foo : "hello world" ...and in the calling script you use the " x of n " style of referencing. set test to (load script "/tmp/a.scpt") display dialog (the foo of test) You can also access the returned result of a

iTunes 10.6.3 changes AppleScript interface?

偶尔善良 提交于 2019-12-06 07:28:40
问题 I have a simple Ruby script that uses the rb-appscript gem to control iTunes, and now that I've updated to iTunes 10.6.3, it appears to be broken. Prior to 10.6.3, this piece of code would work as expected to get the currently selected track(s): Appscript.app('iTunes').selection.get() Now it produces the following error: RuntimeError: Unknown property, element or command: 'selection' Edit: Just confirmed that this is also broken in py-appscript, so it's not isolated to rb-appscript. Which is

AppleScriptTask throwing an error 5 - invalid procedure call or argument

旧街凉风 提交于 2019-12-06 06:22:00
I'm facing a problem on Mac 2016 Powerpoint. In my VBA module I need to run an applescript. As we cannot use MacScript anymore I followed RonDeBruin's explanation to use AppleScriptTask. My Applescript is working fine on his own but when I try to call it like this : AppleScriptTask("hello.scpt", "myhandler", "hello") With in my apple script on myhandler(paramString) say paramString End myhandler It gives me an error 5 - Invalid procedure call or argument my script is placed in Library/Application Scripts/com.microsoft.Powerpoint is this path alright? Thank you for your help I did get that

AppleScript that reads active application name, title and URL

北城余情 提交于 2019-12-06 06:04:04
I need AppleScript that, when lunched from command line, will return three things: current active application name; ex. "Google Chrome", "Safari", "Steam", "iTunes", "Atom" ect. current active application title, if there is one if current active application is a browser, I want the current active tab URL examples: Google Chrome; AppleScript: How to get URL of Safari tab which failed to load? - Stack Overflow; https://stackoverflow.com/ iTunes; iTunes iTerm2; 1. node test.js (sleep) Safari, GitHub - rails/rails: Ruby on Rails; https://github.com/rails/rails I know there are some similar

How do I determine if a user has a password set on Mac?

こ雲淡風輕ζ 提交于 2019-12-06 05:56:16
问题 I need to determine if a user has a non-empty password set on Mac. Anything will work: a command line call, AppleScript, Carbon, Cocoa, etc. I want to inform the user whether or not they have a password set. 回答1: I've found the answer to my question. Thanks anyway. dscl . -authonly <username> "" 回答2: If you are performing an action that would require any user to enter a password, then you should allow them the opportunity to verify that password even if it is empty, and then handle the

using applescript to display Unix Exctable file

可紊 提交于 2019-12-06 05:46:56
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? Try this: set aVariable to do shell script "fullPathToYourExecutable" display dialog aVariable 来源: https://stackoverflow.com/questions/15015172/using-applescript-to-display-unix-exctable-file