Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Making CS2 recognize a changed startup images folder

New Here ,
Jun 24, 2008 Jun 24, 2008
Hi there,

I'm trying to make Photoshop CS2 recognize externally from VB/VBA a change the folder that a user saves a newly created (in this case, scanned) document to.
(e.g., this is the folder that appears when you click File -> Open or File -> Save As, I want to programatically change that while the user is in my application so they can switch to Adobe, scan in a new document, click File -> Save As and be presented with the correct directory to put this image in)

I added Adobe Photoshop 9.0 Object Library to my project and I tried finding this as a property in the Adobe Application, but it doesn't appear there. It turns out that it's kept in the registry (see code snippet below). I try changing this in the registry, but I can't seem to find a way to "ping" Adobe to pick up the registry change. I tried the code snippet below to open a "dummy" file in an attempt to force the directory change that way, as though the user were opening a new file in the directory I want them to be in, but still no go, it doesn't change the registry. It looks like the only two ways I can force this is to manually do it from the UI, or to change the registry entry and restart Adobe. Neither of those are viable options.

Any thoughts please? My client is still stuck on Adobe Photoshop 5.5 (yes 5.5) becuase that still used INI files and that version picked up the currently active directory changes to the INI files.

thanks!
TOPICS
Actions and scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
New Here ,
Jun 24, 2008 Jun 24, 2008
Public Sub test1()

Dim appPhotoshop As Photoshop.Application
Dim strTemp1 As String

Set appPhotoshop = New Photoshop.Application

strTemp1 = GetRegValue("Software\Adobe\Photoshop\9.0\VisitedDirs", "STARTUPIMAGEDIRECTORY")
Debug.Print strTemp1

' Call SetRegValue("Software\Adobe\Photoshop\9.0\VisitedDirs", "STARTUPIMAGEDIRECTORY", "C:\TEMP\FOO1\")

Call appPhotoshop.Open("C:\TEMP\DUMMY.PSD")
Call appPhotoshop.ActiveDocument.Close(psDoNotSaveChanges)

strTemp1 = GetRegValue("Software\Adobe\Photoshop\9.0\VisitedDirs", "STARTUPIMAGEDIRECTORY")
Debug.Print strTemp1

End Sub
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 11, 2008 Jul 11, 2008
After some further digging, I realized that this registry entry is just a shell, a read-only value. The REAL directory setting is stored in a file called Adobe Photoshop CS2 Prefs.psp that is located in C:\Documents and Settings\[Windows UserName]\Application Data\Adobe\Photoshop\9.0\Adobe Photoshop CS2 Settings. This file appears to be binary in nature.

sooo...my question is, does anyone have any experience directly or indirectly editing these PSP files?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 11, 2008 Jul 11, 2008
> sooo...my question is, does anyone have any experience directly or indirectly editing these PSP files?

Uh, yes. That would be me. And a maybe a couple of others around her. Let me
take a look at the file and see what can be done about it.

-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 11, 2008 Jul 11, 2008
>> sooo...my question is, does anyone have any experience directly or indirectly editing these PSP files?
>
> Let me
> take a look at the file and see what can be done about it.

So, I took a look and it doesn't look so good. The PSP files in that folder have
different file formats. Some are basically a set of serialized ActionDescriptor
objects, others are something different.

This file is one of the different ones. To make matters worse, the information
appears to be laid out in native Windows (little-endian) instead of PS-standard
(big-endian) mode.

Reading and/or writing Prefs.psp would take some customized code for its file
format and a lot of byte-level analysis to determine what the overall format
actually is.

So, it's possible, just not easy.

BTW, if you edited the file from a PS script, it would (normally) just get
overwritten when you close PS. Yet more complexity.

-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 11, 2008 Jul 11, 2008
LATEST
Thanks
Hmm...I was hoping to avoid that
It's almost like "hacking" Adobe's custom properties file
and a quick google search on this file looks like most people end up deleting it to have PS recreate it because it gets corrupted
And, like you said, there is no guarantee that if I edit this file directly that PS will pick up the changes
sigh
I was hoping for an API interface rather than a back door method, guess I will keep digging or we will have to change our overall approach
thanks for looking!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines