Photoshop: Run script on file open event from ACR / Adobe Camera RAW - photoshop

I have a script that does a variety of things to the active document on file open in Photoshop (currently on v 23.x - I keep it relatively up to date so that'll change over time)
I run this from the File > Scripts > Script Events Manager: "Open Document" event.
Unfortunately when opening multiple RAW files via ACR (Adobe Camera RAW), it seems the "Open" event is only fired once, after they have all been opened - or more accurately, it appears that the "Open" event may be firing once for each RAW opened, but the activeDocument is always the same most recently opened RAW file - it does not cycle through each file.
This means that my script only runs on one of the opened RAW files (the currently active one). I'm aware that I can do a loops through opened documents etc., but my question is:
Is there a script action / script ID that is fired for each file that is opened via ACR that I can use instead of the "Open Document" event?
Alternatively, is there any way to get a list of the files that were opened in a specific call from ACR? That is, if I already have 2 documents open in Photoshop, and I open another 2 via ACR, can I get a list of just that 2 (as opposed to having to loop through every open document)?

Related

How to email dropbox app file paths as clickable hyperlinks?

The company uses dropbox instead of local servers. We often send files to colleagues, but each user has a unique path to the file stored in the dropbox desktop app (e.g. C:\Users\username\Dropbox...).
I was thinking about writing a batch script to copy a file path and strip the beginning of the path. I would then need another script to add the user specific prefix to the file path, and then open the folder/file in file explorer.
I believe I found a way to add a batch file into the menu that pops up when you right click a file/folder by editing the registry. I was thinking it would be possible to write an Outlook add-in for the receiving user to prepend their drive/username etc. to the file path and then open the file/file explorer if a path to a folder is sent.
I was hoping to get some input on this approach, or to know if there is an easier way to handle this. I haven't started any of the code yet.
Why don't you just start using the Dropbox add-in for Outlook?
Dropbox has created an add-in that integrates with Microsoft Outlook. By connecting the Dropbox add-in to your Outlook account, you can:
Replace email attachments with a shared link to any file, big or small
Save email attachments that you receive directly to your Dropbox account
Ensure those with access to a file see updates to it (since shared links always point to the latest version of a file, whereas attachments are just a static copy)
Enabling the integration adds a Dropbox icon to the Outlook compose window. When you click this icon a pop-up window appears, allowing you to select from the contents of your Dropbox. A shared link to any selected file or folder will appear in the body of the email.
While this link looks like an attachment, it's, in fact, a shared link. This means no slow-down in sending emails, and no space limitations in your inbox.
Anyway, if you still want to develop an add-in for extracting an attachment's file path you need to start with Walkthrough: Create your first VSTO Add-in for Outlook.
The NewMailEx event of the Application class which is fired once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem and etc. The EntryIDsCollection string contains the Entry ID that corresponds to that item.
The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item. Use this method with caution to minimize the impact on Outlook performance.

VBA IE 10 Automation - Automatically Save PDFs

I'm trying to automate the process of saving PDF invoices for bookkeeping purposes. The method suggested here does not work because a login is required to access the invoices.
I currently have a macro that navigates to the page, logs in and opens the links to each invoice. The URL scheme for these invoices is .../account/invoice/?invoice_number=XXXXXX. Navigating to each of these URL brings up the files in the
window. I would like the files to automatically save, but according to this page, the Always ask before opening this type of file option was depreciated from IE 10 and 11 due to security reasons.
I attempted to automatically click Save using this method, but the code here seems to be for a different version of IE.
The line:
hWnd = FindWindow("#32770", "File Download")
was modified to:
hwnd = FindWindow("#32770", "View Downloads - Windows Internet Explorer")
This successfully captures the download window, but it fails to find the &Save button for me to click. My guess would be that it's because there are multiple save buttons.
Any ideas would be greatly appreciated! Thanks.

Resume Opening Workbook After Addin Interrupts

I've written an Excel addin that periodically checks a remote repository for data updates, including a check when the addin loads at Excel start up (during the addin's Workbook_Open event). If new respository data is detected, the addin asks the user for permission to proceed with the update. If the user clicks "yes", the addin successfully updates itself and everything is happy... except...
If Excel is not already running and the user selects an Excel file to open (e.g. via double-click in Windows), this sequence of events occurs and everything works, but the user-requested file opening is interrupted and not re-engaged. The Excel app is running, but with no workbook loaded (the workbook area is an empty frame).
I believe I have two options, neither of which I know how to accomplish:
Prevent the addin from completing its update check until the user-selected file has completed its open sequence and is fully loaded, or
Allow the addin to update itself and then somehow re-engage the user-selected file to complete the file open/load.
I have not been able to discover the filename/path of the user-requested file, so my addin isn't able to direct that file to be loaded.
My current workaround is a MsgBox telling the user to close Excel and re-open the selected file. Ideally, the addin update should occur and the original action should complete without requiring user intervention.
(Building on Option 1, I could start a delay timer for the addin to check for updates XX number of seconds after Excel starts, but this seems kludgy to me.)
Any guidance or ideas are appreciated. My interwebz searches aren't hitting the right combination of keywords for the exact scenario.
Instead of opening the new addin update file immediately you can use OnTime to delay it which should allow the other file to open successfully. See here: Process for updating Excel add-in?
In the answer you'll also see a reference to this package here which does everything you need. Autoupdates are hard so I would recommend going with someone else's solution.
http://www.decisionmodels.com/downloads.htm#addload
(Scroll down to Add-In Loader Version 2)

Excel VBA to change internet explorer advanced settings

My current program that I am using, from excel, navigates to a web page where it downloads a lot of information. I primarily do this from excel because the data is in excel format.
I have it go to the page, click on a link and the open/save/cancel dialog box appears it automatically selects save and saves it to the last folder I saved anything in. Then it waits for the dialog box title to read "download complete" then close it and initiates the next download.
The issue I'm running in to, is that other people who use this program have the "close dialog box when download completes" option selected, and this interrupts the overall process.
Is there a way to change this setting from the excel VBA code, or will I need to explore a different method of dealing with this issue? Having the program do a direct download URL string is also not viable as the website needs to be logged in to and the request must come from the open window, (I have already attempted that method).
Use URLDownloadToFile to download from the internet, trying to use IE will lead to other issues:
VBA - URLDownloadToFile - Data missing in downloaded file

How do I handle the closing event of a windows explorer window using VB.NET

I'm working on an application where I have a list of hidden directories in a treeview. When the user double clicks on a folder in the directory structure, I open up that folder using the code:
Process.Start(tvHiddenFolderListing.SelectedNode.FullPath)
Now, the the files within the folders are hidden as well so when it opens the folder, you cannot see the files (Provided view hidden files and folders is not selected.). What I want to do is:
1) when the folder in the tree view is double clicked, I will un hide the files, then open the folder using the process.start code so users will be able to see the files.
2)When the explorer window that opens up upon double clicking is closed, I want to hide the files again. This is where my query lies.
I figured I have the following options:
1) Handle the onClose event for this explorer window and add the code to hide the folders and files within this event.
2) Create a new form in my project an open the path in the process.start above, in this form. In other words, make my own windows explorer form so I can handle the onClose event of this form accordingly.
3) I know how to get the process ID for the explorer window when I start it using process.start. I could check when the process is killed, or exited and hide the folders then.
In a nutshell, I want users to double click the folder in the tree structure, open up that location in a windows explorer and browse it as they normally would browse any other folder on their computer, but I want to have the ability to specify what happens when that window is closed, i.e. hide the files again.
I would greatly appreciate any assistance on achieving my goal via any of the above mentioned methods or an alternative that you think would be better suited.
Thanks in advance.