Try to get the JSX execution path ($.filePath does not)

I'm trying to get the location of the directory of the current script (main.jsx of my Panel).
I tried to use $.filePath without success...

Alert($.) FilePath);
Returns undefined or int

var thisFile = new File($.fileName);
Alert (thisFile);

Returns /c/Program%20Files/Adobe/Adobe%20Photoshop%20CC%202015

var thisFile = new File($.fileName).parent;

alert (thisFile .fsName);

Returns C:\Program Files\Adobe\Adobe Photoshop CC 2015

What I am doing wrong?
I need to get the path of the currently executing script file if I do .parent for its folder name and obtaining an apparent folder name where I have a few things to recover. I run this in my main.jsx - file.

Found the solution!

By running this code in the javascript of your extension file, you will get the path:

var csInterface = new CSInterface();
var extensionRoot = csInterface.getSystemPath(SystemPath.EXTENSION) + "/jsx/";
alert(extensionRoot);

Credits goes to Barranca of Davide

Tags: Photoshop

Similar Questions

  • Try to get the first sentence only - code does not

    It makes me crazy - code works on a single page, but not on another, and I can't understand why. The code I use to get out of the first sentence of a field is as follows:

    < cfset variables.firstsentence = Find (".", #get_spotlight.description #) >

    < cfoutput query = "get_spotlight" >
    < p > < #title # < br / >
    #Left (description, variables.firstsentence) # (< a href = "database_spotlight.cfm? link_id = #link_id #" > learn more < /a >) < /p > < / cfoutput >

    It works here: http://www.richland.lib.sc.us/research.cfm

    I try to use the same code on another similar page, and the same code does not work. It takes only the first 40 characters or more and I don't know why. I guess it's something to do with the surrounding code, but I don't see what. Can someone enlighten us on that before go me crazy?
    Here's the page I'm working on: http://www.richland.lib.sc.us/sample/linkstest6.cfm?subjecttype_id=16
    And here's all the code (in case something else is causing the problem)

    < cfquery name = "get_links()" datasource = "links_1", dbtype = "ODBC" >
    SELECT links.link_id, links.title, links.link, links.description, links.url_home, links.icon, links.url_tutorial, links.discus,
    Links.Subscription, subjecttype.subject_name, subject.link_id, subjecttype.subjecttype_id, subject.subjecttype_id
    Links, subjecttype, subject
    WHERE links.link_id = subject.link_id
    AND subjecttype.subjecttype_id = subject.subjecttype_id
    AND (subject.subjecttype_id = #url.subjecttype_id #)
    ORDER BY title
    < / cfquery >

    < cfset variables.firstsentence = Find (".", #get_links.description #, 0) >

    Output (with some HTML stranger deleted - sorry for the lengthy code - I'm sure there's probably a shorter, more elegant way to do..):

    < cfoutput query = "get_links()" >
    < cfif subscription IS "Yes" >
    < cfif IS 'Home' icon >
    < cfif url_home IS "" > <!-> the same in-house/remote url ".
    < p > < img src = "" #icon #4.gif "alt ="database icon"width ="20"height ="20"align ="absmiddle"/ >"
    < span class = "bold" > #TRIM (title) # </span > < cfif get_links.discus IS 'YES' >
    "" < img src = "... / pictures/discus_logo.gif" alt = "DISCUS" width = "61" height = "17" align = "absmiddle" / > < / cfif > < br / >
    #Left (description, variables.firstsentence) # < br / > < a href = "#link #" title = "#TRIM (title) #-inside the library" > inside the library < /a > |
    < a href = "" #link # "title =" #TRIM (title) #-home access "> home access < /a >"
    | < a href = "database_spotlight.cfm? link_id = #link_id #" > < img src = "moreinfo4.gif" alt = "More information" width = "20" height = "20" align = "absmiddle" / > < /a > "
    < cfif url_tutorial IS NOT "" > | "."
    "< a href ="... /... "/PDF/ #url_tutorial #" > < img src = "tutorial4.gif" alt = "Tutorial" width = "20" height = "20" align = "absmiddle" / > < /a > "
    < / cfif > < / p >

    < cfelse > <!--> two show internal URL / remote
    < p > < img src = "" #icon #4.gif "alt ="database icon"width ="20"height ="20"align ="absmiddle"/ >"
    < span class = "bold" > #TRIM (title) # </span > < cfif get_links.discus IS 'YES' >
    "" < img src = "... / pictures/discus_logo.gif" alt = "DISCUS" width = "61" height = "17" align = "absmiddle" / > < / cfif > < br / >
    #Left (description, variables.firstsentence) # < br / > < a href = "#link #" title = "#TRIM (title) #-inside the library" > inside the library < /a > |
    < a href = "" #url_home # "title =" #TRIM (title) #-home access "> home access < /a > |" < a href = "database_spotlight.cfm? link_id = #link_id #" > < img src = "moreinfo4.gif" alt = "More information" width = "20" height = "20" align = "absmiddle" / > < /a > "

    < cfif url_tutorial IS NOT "" > | "."
    "< a href ="... /... "/PDF/ #url_tutorial #" > < img src = "tutorial4.gif" alt = "Tutorial" width = "20" height = "20" align = "absmiddle" / > < /a > "
    < / cfif >
    < /p >
    < / cfif >
    < cfelseif icon is "inhouse" > <!--see the internal url-->
    < p > < img src = "" #icon #4.gif "alt ="icon of the database"align ="absmiddle"/ >"
    < span class = "bold" > #TRIM (title) # </span > < br / >
    #Left (description, variables.firstsentence) # < br / > < a href = "#link #" title = "#TRIM (title) #-inside the library" > inside the library < /a > | < a href = "database_spotlight.cfm? link_id = #link_id #" > < img src = "moreinfo4.gif" alt = "More information" width = "20" height = "20" align = "absmiddle" / > < /a > "

    < cfif url_tutorial IS NOT "" > | "."
    "< a href ="... /... "/PDF/ #url_tutorial #" > < img src = "tutorial4.gif" alt = "Tutorial" width = "20" height = "20" align = "absmiddle" / > < /a > "
    < / cfif > < / p >
    < / cfif >
    < / cfif >
    < / cfoutput >
    < p > < / p >
    < h3 > librarian - selection of Web Sites < / h3 >
    < cfoutput query = "get_links()" > <! - no subscription sites - >
    < cfif subscription IS 'No' >
    < p > < img src = "" #icon #4.gif "alt ="icon of the database"align ="absmiddle"/ >"
    < a href = "" #link # "title =" #TRIM (title) #"> #TRIM (title) # < /a > < br / >"
    #Left (description, variables.firstsentence) # < br / >
    < a href = "database_spotlight.cfm? link_id = #link_id #" > < img src = "moreinfo4.gif" alt = "More information" width = "20" height = "20" align = "absmiddle" / > < /a > < /p > "
    < / cfif >
    < / cfoutput >

    Thank you for reading this day and for any help or suggestion.

    YES! That's all--woohoo! Thank you very much. In addition, this explains why the same piece of code works on another page - this page I only shot one record instead of many. I looked up the ListFirst function and I understand that - but I never would have thought it myself.

    Thank you very much for coming up with the answer - and thanks to everyone who took the time to try it - I really appreciate it.

    Quote:
    Posted by: Swift
    Hi Michelle,

    If I'm right, then it is a simple problem. The simplest are good. :)

    That's what you have:


    <>

    #Left (description, variables.firstsentence) # (read more...)

    What you have done is in the position of the period off the first record in the data base by base and then applied to all records in the database. So you're cutting posted on 40 every time, because you will find that the first record in the database should be cut to the 40 position. Instead, you simply calculate the position each time inside the loop. In addition, we will just go ahead and make it even easier by using ListFirst...


    <>

    #ListFirst (description, ".") # (read more...)

    That should do it. By the way, if you really want the period appear (which I imagine you do), then just use:

    #ListFirst (description, ".") #.

    Instead of

    #ListFirst (description, ".") #.

    HTH,
    SWIFT

  • Get the error 'windows wireless service does not work on this computer' diagnose in Wireless adapt

    Get the error 'windows wireless service does not work on this computer' diagnose in Wireless adapt. The same is not solved.

    I'm unable to locate networks wireless on my Windows 7 PC. Help, please.

    Try to uninstall/reinstall the drivers for your wireless network. You should be able to get them from from Toshiba Web site.

    I hope this helps.

  • I try to install the progrsm Fixit and it does not allow me to make the race he leaves on the download

    original title: installation FIXIT

    I try to install the progrsm Fixit and it does not allow me to make the race he leaves on the download?

    Hello

    1. What operating system do you work?
    2. What Fix - it you are trying to install?
    3. What version of internet explore do you use?

    Please refer to the below link mentioned before asking your question so that you can provide all the relevant information for us to help you:

    http://support.Microsoft.com/kb/555375

    You can try the following:

    Remove temporary internet files

    http://Windows.Microsoft.com/en-us/Windows7/delete-files-using-disk-cleanup

    Also try to save the file on your computer, then run it.

  • Windows PC upgrade to 10. Try to install the first Pro CS5. Does not work.

    Windows PC upgrade to 10. Try to install the first Pro CS5. Does not work.

    Download the following messages: Exit Code: 7 please see the faults and warnings below for troubleshooting. For example, ERROR: DW050... WARNING: DW036, DW066...

    -0 fatal Error (s), 82 (s), 124 warning (s)

    Any idea?

    Thank you

    Jaap

    Do you have other Adobe applications installed on your computer?

    Navigate to C: > Program Files > Adobe.

    Open the Adobe folder and check if the Adobe Premiere pro CS5 folder is created with files stay inside?

    Let us know.

    As System File Checker run command once and see if \any system files are corrupt. As you had upgraded to Windows 10 we will check the system files once. Later we can try to provide full permissions for the required records.

    https://support.Microsoft.com/en-in/KB/929833

  • Try to run Defrag/Task Scheduler Service, get the message 'Task Scheduler Service does not work' in Windows 7

    I'm trying to defragment my system (Windows 7).  When I go to START and type in "Defragmenter" it states: "the Task Scheduler Service does not work.  "Start the Task Scheduler Service and try again.  When I do, the following message appears: "the remote computer is not found.  Please tell us what to do next.  Thank you.

    Task Scheduler, Windows event log, and the RPC end Point Mapper are included to start automatically?

    Click on the Start button and select Control Panel, administrative tools, Services. Locate the Windows event log in the list. Check that he started and that the startup type is automatic. If it is not set to automatic, right-click and select Properties, general tab. There is a box after the startup type. The options are available in a menu drop-down by clicking on the down arrow to the right of the box. Make the change and click apply and then click OK. Restart the computer and verify if it has started.

  • When stopping down to the EXP get the message "rundll.exe program does not ' and computer does not turn off. How should I do?

    Can't stop it to exit the mode and get the data message may not be saved.

    Hello

    Windows operating system you are using?

    Step 1: You can check if the same problem occurs in safe mode with network.

    Please follow the link on how to start the computer in safe mode with network below.

    http://Windows.Microsoft.com/en-us/Windows7/start-your-computer-in-safe-mode

    Step 2: Clean boot

    How to set up Windows 7 to start in a "clean boot" State

    http://support.Microsoft.com/kb/929135

    Note: After a repair, be sure to set the computer to start as usual as mentioned in step 7 in the above article.

    For reference:

    What version of the operating system Windows am I running?

    http://Windows.Microsoft.com/en-us/Windows7/help/which-version-of-the-Windows-operating-system-am-i-running

    Let us know if that helps.

  • my computer told me to repair windows.and everytime I try I get a blue screen. It does not start in any mode without failure. I just get a blue screen. Thany you shane

    whenever I try to start my computer .a blue screen come often does not start in any of the modes security .He told me to repair windows recommended. can't do recovery or what he can be.wont start in safety mode.what can I do .thank you. Leonard.

    Hi leonardhurley,

    Since when are you facing this problem?

    You did changes before this problem occurs?

    What is the exact blue screen error message you received?

    Method 1

    I suggest that you perform the last good known Configuration

    http://Windows.Microsoft.com/en-us/Windows-Vista/using-last-known-good-configuration

    Method 2: disable automatic reboot in order to collect the Blue error screen, so in case the blue screen just flashes and dries on.

    Method 3:

    I suggest you to follow the article below for the Blue error screen.

    http://support.Microsoft.com/kb/958233/en-us

  • I get the error message saying twtter does not recognize my e-mail account

    I tried to connect to my twitter account and it keeps saying that twitter does not recognize my account. How can I fix it? can I call twitter?

    Hello

    Please see the following link for assistance Twitter.

    Twitter Help Center:
    http://support.Twitter.com/

    Concerning

  • the poster of the Bookmarks window is too big (suddenly occurred with the new version). I can't figure out how to get the smaller screen. Zoom does not work on the display of the menu bookmark.

    I have the 4 version, just download and a Mac OS 10.6. w. 7.
    Display the bookmarks (when I pull to the low "bookmarks") is far too broad. I can't understand how to reduce the display size. The window is not persistent, so I can't yet get you a screenshot.
    Thank you, Sara

    It seems that there is a change in Firefox 4, where the width of the drop-down list is now determined by the length of the longest bookmark name in the displayed folder. Versions previous of Firefox would be to shorten a long name like this and add an ellipsis to indicate the name has been truncated.

    Sorry, I don't know how to change it otherwise that you advise to change the name of this long bookmark name and make it less wordy. Just scroll to the bottom of the list of bookmarks in this vast folder until see you the culprit, then right click on that bookmark and open properties and change the line of name at the top of this dialog box.

  • Vista - when the computer is shut down, continue to get the same updates offered and does not

    Update of security for MICROSOFT.NET Framework 4 on Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008, Windows Server 2008 R2 for x 64 systems (KB2160841)

    Everytime I go I turn off I get this update. It happened now 57 times in the last month. It seems that the downlaod fails when checking for details. Is it possible that I can remove the update total.

    * original title - Codes *.

    How to hide updates or restore the hidden in Windows Vista updates
    http://www.itechtalk.com/thread5013.html

    The problems with the installation of the updates:
    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-installing-updates

    Your problem can be solved or answered if you post on the forum of Windows Update:http://social.answers.microsoft.com/Forums/en-US/vistawu/threads

    JS
    http://www.PAGESTART.com

    Never be afraid to ask. This forum has some of the best people in the world to help.

  • Help! Try to update the values of Member - but does not (completely).

    We are trying to resolve a calculation in the middle of the update of business cycle. There is a push to update existing values for an account specific forecast time scenario.

    Essentially, we want to update the value of forecast current account 56400 to 0.33 * ("56100" + "56110" + "56300" + "56310" + "56320").

    The solution is to make sure only rest of the current year, Apr - Dec, updated forecasts to date.

    Currently the rule runs, but handful of values is never get updates - I'm not doing correctly?

    relatively small cube BSO, Account (dense).

    Here is the rule of this task running

    SET CACHE HIGH;

    FIX (& those 'Forecasts', 'the current iteration","F_00000");

    "56400")

    IF (@ISMBR (& NextMonth: "Dec"));

    0.33 * ("56100" + "56110" + "56300" + "56310" + "56320");

    ENDIF ;)

    ENDFIX;

    -followed by a calc all

    I expect to update all occurrences 56400 in the fix above...

    Thanks in advance!

    Himanshu-

    You probably need...

    UPDATECALC OFF SET;

    .. Smart calc or .in there will prevent 'own' blocks to be recalculated.

  • Cannot download update for Sony's Vaio Vista successfully. More detailed information, I have Kaspersky Anti-virus and Maximizer CRM database. I have to disable one of these applications to get the Windows Update? Computer does not behave normally.

    -Computer laptop Sony Vaio
    -Kaspersky Anti-virus
    -Anti-virus maximizer

    Uninstallation of one (1) of the anti-virus applications (preferably not the one you bought).

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • When I run Adobe Lightroom 6, I get the error: AgTransitCargo_pushTransitCargo - wichitafoundation.dll does not start.

    AgTransitCargo.png

    I reinstalled Lightroom with the CD. Problem stays.

    Hi paulp,.

    Greetings.

    It seems that Lightroom makes a call to the AGkernel.dll file, this can occur when AGkernel.dll is damaged and must be repaired or AGKernel.dll version is incorrect and should be updated to the correct version.

    Here are some things you can do to fix the file:

    Let us klnow if that helps.

    Concerning

    Assani

  • So frustrated... have CS5 and whenever I try to use the clone stamp, it just does not move picture.  I click on duplicate, move the image to press option and the minute I move stamp image, it starts moving around image as if there are two pictures the

    Frustrated by the clone in CS5 stamp.  Whenever I go to the for use, it just moves the image as if I had multiple layers.  Is anyone out there can help with this?

    Check the palette Source of duplication for options that you forgot which allows...

Maybe you are looking for