Skip to main content
Participating Frequently
July 20, 2023
Answered

Where is "Liquify Last Mesh.psp" stored on Mac?

  • July 20, 2023
  • 4 replies
  • 445 views

I have this code which works on Windows for applying the last liquify mesh, but doesn't work on Mac. I believe it is because of the reference to the file "Liquify Last Mesh.psp". Does anyone know what the equivalent of this file would be on Mac/where it would be located? I would look, but I don't own a Mac, unfortunately.

function getOperatingSystem() {
    var os = $.os.toLowerCase();
    if (os.indexOf("windows") >= 0) {
        return "Windows";
    } else if (os.indexOf("mac") >= 0) {
        return "macOS";
    } else {
        return "Unknown OS";
    }
}


// APPLY LIQUIFY TO CURRENT LAYER
function applyLiquify() {
    var dialogMode = DialogModes.NO;
    var idLqFy = charIDToTypeID( "LqFy" );
    var applyLiquify_d = new ActionDescriptor();

    var currOs = getOperatingSystem();
    if (currOs === "Windows") {
        applyLiquify_d.putString(charIDToTypeID("LqMD"), app.preferencesFolder.fsName + "\\" + "Liquify Last Mesh.psp");
    } else {
        // unknown OS or Mac version
        applyLiquify_d.putString(charIDToTypeID("LqMD"), app.preferencesFolder.fsName + "/" + "Liquify Last Mesh.psp");
    }
    try {
        app.executeAction(idLqFy, applyLiquify_d, dialogMode);
        return true;
    } catch (e) {
        alert("applyLiquify" + e + " " + e.line);
    }
    return false;
}

 

This topic has been closed for replies.
Correct answer Stephen Marsh

@Jacob Dallas 

 

EDIT 2: I think the issue is your platform checking code, removing it from your code works for me on a Mac:

 

// APPLY LIQUIFY TO CURRENT LAYER
applyLiquify()

function applyLiquify() {
    var dialogMode = DialogModes.NO;
    var idLqFy = charIDToTypeID("LqFy");
    var applyLiquify_d = new ActionDescriptor();

    applyLiquify_d.putString(charIDToTypeID("LqMD"), app.preferencesFolder.fsName + "/" + "Liquify Last Mesh.psp");
    
    try {
        app.executeAction(idLqFy, applyLiquify_d, dialogMode);
        return true;
    } catch (e) {
        alert("applyLiquify" + e + " " + e.line);
    }
    return false;
}

 

 

As the path and file is universal, there is no need to check for Mac vs. Win OS.

4 replies

Stephen Marsh
Community Expert
Community Expert
July 21, 2023

This platform checking code works for me on both OS:

 

var os = $.os.toLowerCase().indexOf('mac') >= 0 ? "mac" : "windows";
if (os === 'mac') {
    // Mac stuff here...
} else {
    // Windows stuff here...
}
Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
July 20, 2023

@Jacob Dallas 

 

EDIT 2: I think the issue is your platform checking code, removing it from your code works for me on a Mac:

 

// APPLY LIQUIFY TO CURRENT LAYER
applyLiquify()

function applyLiquify() {
    var dialogMode = DialogModes.NO;
    var idLqFy = charIDToTypeID("LqFy");
    var applyLiquify_d = new ActionDescriptor();

    applyLiquify_d.putString(charIDToTypeID("LqMD"), app.preferencesFolder.fsName + "/" + "Liquify Last Mesh.psp");
    
    try {
        app.executeAction(idLqFy, applyLiquify_d, dialogMode);
        return true;
    } catch (e) {
        alert("applyLiquify" + e + " " + e.line);
    }
    return false;
}

 

 

As the path and file is universal, there is no need to check for Mac vs. Win OS.

Participating Frequently
July 21, 2023

Worked like a charm! Appreciate your help 🙂

Stephen Marsh
Community Expert
Community Expert
July 21, 2023

You're welcome!

Legend
July 20, 2023

https://helpx.adobe.com/ca/photoshop/kb/preference-file-names-locations-photoshop.html

Search the page for the name "Liquify Last Mesh.psp".
Logically, this is the same place as app.preferencesFolder.
Try to use not app.preferencesFolder.fsName but app.preferencesFolder.fullName
 
P.S. You can find out the path (and code) using the ScriptListener plugin. I don't know if it's available for Mac.
 
 
 
 
 
Participating Frequently
July 21, 2023

Really helpful reference, thank you!

Participating Frequently
July 20, 2023

This is for Photoshop by the way.