Access/working directory of the script path?
Hi all
Came across an interesting behaviour regarding the path of working within AE scripts directory. When a range of the object / global, directories are compared to the DDT in the script itself. However, within the scope of an eventHandler... in my case onClick function... directories are related/Volumes /. In the code:
File1 var = new File ("tmp");
Alert (file1.fsName) is translated by "/ Applications/Adobe After Effects CS6/Scripts/ScriptUI Panels/tmp".
button.onClick = function() {}
File2 var = new File ("tmp");
Alert (file2.fsName) is translated by "/ Volumes/tmp".
}
I'm curious to know why the DDT changes in this situation. I know I can get the pwd via. Filename $ and as the file name. Is there another way to determine the DDT? A way to ensure that the DDT will be the directory of the script within the eventHandler?
I can work around this problem, but want to understand as much as I can to see if there are other options and best practices.
Thank you!
Calvin
Featured is released without having to analyze the path of the file manually. Pretty simple/straightforward...can't believe that I don't think that this earlier...
var path = (new File($.fileName)) .path;
Welp... who puts that to bed!
Tags: After Effects
Similar Questions
-
CD to the directory of the script
Is there a shorter way than what follows to start "do shell script" with "cd" into the directory containing the script?
the "x =" shell script & form of POSIX path of (path for me) quotes & " "CD ${x%/*}".
I have a script saved on my desktop. The following code will change the directory for this folder on the desktop and echo that present the working directory. I try to keep as much of the complexity of the do shell script as possible.
say application 'Finder' to the value script_dir to POSIX path of ( container (path to me) as text)
the shell script "cd" & script_dir & " echo $PWD.
-
Hello
I want to automatically change the working directory of the node Mathscript in a VI in the working directory of the VI, while I don't have to specify every time where is my file ".m", as most likely, it will be in the same folder as the VI.
Thank you
Walid F. van
Hi Wade,
The following picture illustrates how to add the directory to your VI to MathScript search paths.
-
Works only in the script file and not in the database
Hi all:
I want to know if this is possible.
In my SQL script file...
Create a feature once.
Call or make use of this couple of function or several times.
All the while NOT create the function in the database.
In other words, I want this function to be alive only during execution of the script file.
Thank youWell, you can do that if you can somehow manipulate your script so that it includes an anonymous block. Here, you can use a local subprogram that exists in the context of the anonymous block:
SQL> DECLARE 2 a1 NUMBER := 10; 3 a2 NUMBER := 20; 4 a3 NUMBER := 0; 5 6 FUNCTION calu_sum (var_a NUMBER, var_b NUMBER) 7 RETURN NUMBER 8 IS 9 BEGIN 10 RETURN (var_a + var_b); 11 END; 12 BEGIN 13 a3 := calu_sum (a1, a2); 14 DBMS_OUTPUT.put_line (a3); 15 END; 16 / 30 PL/SQL procedure successfully completed.
Kind regards
FrébaultPublished by: Marie Lise Sharma on May 6, 2009 13:58
-
I have problems loading something in a relative path via a script, on my computer I have no problem, but the other 2 devices at work, it does not work. Even at home on a PC and a mac, that I've not met problems, someone at - it a glimpse of this?
Here's where it fails:
#include common.jsx
It's this loading in the same way another script is called from. Thoughts?
I remembered that we have weird permission to labor issues. Somewhere between my horrible Home Windows 8 (permissions issues) machine with network, my home mac, email and my work computer, obtained permissions basket case. Workaround for this is copy the file to my desktop, exactly the same task on the network. This resolved all the issues.
-
Multithreading works only with the direct path load
Oracle DB version: Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
I'm on my way live load to load data from a flat file into a table using SQL * Loader. I also kept as parallel. However, I can't in multithreading is used at all, based on the report of the log file.
I use the settings according to the true value in the sqlldr: -.
parallel=true , multithreading=true , skip_index_maintenance=true
Output in the journal sqlldr:-
Path used: Direct Insert option in effect for this table: APPEND
Trigger DEV."R_TM_BK_BORROWER" was disabled before the load.
DEV."R_TM_BK_BORROWER" was re-enabled.
The following index(es) on table "YO"."TM_BK_BORROWER" were processed:
index DEV.I_NK_TM_BK_BORR_1 loaded successfully with 1554238 keys
index DEV.I_NK_TM_BK_BORR_2 loaded successfully with 1554238 keys
index DEV.I_NK_TM_BK_BORR_3 loaded successfully with 1554238 keys
index DEV.I_NK_TM_BK_BORR_31 loaded successfully with 1554238 keys
Bind array size not used in direct path.
Column array rows : 5000
Stream buffer bytes: 256000
Read buffer bytes: 1048576
Total logical records skipped: 1
Total logical records read: 1554241
Total logical records rejected: 48
Total logical records discarded: 2
Total stream buffers loaded by SQL*Loader main thread: 7695
Total stream buffers loaded by SQL*Loader load thread: 0
So, I can still see the newspaper sqlldr that all data flow buffers loaded by the main thread and load wire is not always used.
SQL * Loader load wire do not unload the SQL * Loader main thread. If the load wire supports the current stream buffers, then it allows the primary thread to build the buffer to the next stream while the thread of load load the current stream to the server. We have a server CPU 24.
I'm not able to find a clue on Google too. Any help is appreciated.
People, Tom Kyte has finally responded to my message. Here's the thread on asktom-
http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:1612304461350 #7035459900346550399
-
Writing in the app-storage inside the worker directory
Hello
In my Adobe AIR (desktop) application, I wrote a class FileDownloader using insternally an instance of FileStream to write remote files in the application storage directory
The problem is that the user interface crashes during the download process (even if I open the local file asynchronously)
As a solution, I thought it might be a good idea to use a worker to download these files, but when I try to write to the directory of storage app of my worker thread
the worker, he writes in this folder: %appdata%\[Worker].null\Local Store
As you can see, app storage directory is inside this folder named ".null [worker]" instead of being in my true app-storage dir (named by my ID app)
A solution I found to write downloaded files in a tmp file, then, in the main Worker Thread, use moveToAsync to move the file to my app-storage directory, but it's not very clean... and moveToAsync takes time with large files...
Has anyone experienced this problem?
This is the normal behavior or is it a bug? I think that the worker should have the same app as application storage directory that integrate it (especially when you set giveAppPrivileges = true in the createWorker method)
Thank you
(and sorry for my English)
Hello
Having worked with several workers on my own project, I had the same behavior.
The solution I found was to set a property that is shared on the worker and the native path of the application.
So, on the key worker, you get the native path of applicationStorageDirectory and then set the property shared on the worker.
It will be useful.
Kind regards
Leo
-
I uses a script, I didn't write, but its summer gave me to use regularly and in the script there is a simple function which is a failure, it's a path test and the creation if the path does not exist.
This is the code that does NOT work:
#Create working directory
$0 = test-Path "c:\working" if (! $0) {mkdir "C:\working" - ErrorAction: SilentlyContinue}
OK, even if I worked with the scripts here and there, I am not a guru and often as smaller which leaves me stumpted.
IF someone with a certain wisdom could answer to help me understand 1) what must be changed to fix this to make it work, 2) what is the $ 0 means at the beginning of this line of code because I've not used it before and wonder about this
Thank you in advace for assistance.
There seems to be a lack of CR - LF, the script should look like this
#Create working directory
$0 = test-Path "c:\working".
If (! $0) {mkdir "C:\working" - ErrorAction: SilentlyContinue}
The Test-Path cmdlet returns a Boolean value ($true or $false) is that the directory exists.
The result is stored is stored in the variable $O
The if condition is NOT the value in $O, so if the directory does not exist, $o would contain $false and NO $false becomes a $true.
And then the directory is created.
-
How do I update the script on Linux
I try to use powerful Linux system and run OATS there. Original screenplay has been developed under Windows and it contains the absolute path as "C:/users/oats...file.properties". I moved in together the OTF file in Linux, tried to run the script (stupid me)-got 'file 'C:/users/oats...file.properties' not found. Fine. Make sense. Fixed path on Linux to the appropriate location as ' / apps/oats/...file.properties'. Run again in BTA (thank you, developers of OATS, for not supporting OpenScript on Linux)-same error. Congested OTF directory, copy, difficulty of location - folder always wanted under C:.
Obviously olt set cached an older version of the script somewhere finding files gave nothing. Where could this be?
Resolved. BTA doesn't source, editing without OpenScript compilation produces no result. BTA runs GTM files that are compiled by OpenScript.
So what worked:
Modify the script in Windows OpenScript (fixing here at Linux and correct path)
Build in OpenScript (or simply play again)
Copy the JWG files in Linux
Enjoy.
-
File snapshot working directory / Suspend?
I use Fusion 3.0 and I have one of my virtual machine stored on a NAS. I have access to the content of the image of the virtual machine on the network. When I suspend the virtual machine, I get the following warning:
"The snapshot file / suspend is stored on a remote file system." You will get better performance if you specify a directory on a local file system for this file. You can specify a directory for your snapshot file / suspend setting the working directory in the Virtual Machine configuration Options. Click OK to continue, Cancel to abort. »
However, I find no setting anywhere we will tell me the location of the file snapshot/suspend. Can somone tell me where this setting is to?
You can separate the VHD in management of VM files. First of all, you should shut down your virtual machine and remove any instant assets via the Snapshot Manager to suspend the machine. Go to Virtual Machines > settings and delete your virtual hard disk. Merge you will be asked if you want to move the virtual disk in the trash, answer NO (or the disc may be removed).
Then, open the package of virtual machine on your NAS and exit the virtual disks to a common location. If the disc is in split format, you need to move all parties, for example disk.vmdk, s001.vmdk - disk, disk-s002, vmdk, and al. set.
Return the rest of the VM package to your local Mac, i.e. Documents > Virtual Machines. This should be a small, fast, copy before everything, including the .vmx virtual machine configuration file. Open the package VM in Documents > Virtual Machine. Go to the Virtual Machine > settings and add your virtual drive on the NAS with + (add the hard drive). Use the open dialog box to locate the virtual disk on the NAS. If requested, do not choose the option to copy the ramdisk (defeats the purpose), but the share of the choose option disc.
In this configuration, your files of disruption/recovery will be local, but the virtual disk (99%) of the space of your VM's on the NAS.
-
Create directory on the client side.
Hi all
I created a directory on the client system to the user, which can save files in this directory and load the data from the user interface in the database table. But the directory created on the server side. and there is an error produced than found directory on SYS. ORACLE_LOADER.
Please solve the problem? I want to create directory on the client side only and no problem.
CREATE or REPLACE DIRECTORY PRAD_DIR as "C:\abc." -Create server-side
Thanx.A "DIRECTORY" is only accessible by a Server process, so the physical directory must be present (or accessible) on the database server.
Say you are using a database of 11.2.
The client might be
SQLPlus 9.2, 10.x, 11.x
SQLDeveloper x.x
PLSQL Navigator / TOAD x.x
Another base 11.x 9.2 - access to the database target through a DBLink
Any other 3rd party Application Server / Client JDBCOracle cannot guarantee that each of these clients can access a "directory" in the same way as a process server.
So: A DIRECTORY cannot be on a client.
Hemant K Collette
-
Firepower does not work when using the Active Directory group as a rule filter access control
I am PoV of Cisco ASA with the power of fire with my client. I would like to integrate the power of fire to MS Active Directory. Everything seems to work properly.
-Fire power user agent installation to complete successfully. Connection to AD work fine. The newspaper is GREEN.
-J' created a Kingdom in FireSight and you can download users and groups from Active Directory.
-J' created a politics of identity with passive authentication (using the field I created)
-Can I use the AD account "user" as a filter in access control rule and it work very well.
However, if I create the rule of access control with AD Group', the rule never get match. I'm sure that the user that I test is a member of the group. Connection event show the system to ignore this rule and the traffic is blocked by the default action below. It doesn't look like the firepower doesn't know that the user belongs to the group.
I use
-User agent firepower for Active Directory v2.3 build 10.
-ASA 5515 software Version 9.5 (2)
-Fire version 6.0.0 - 1005 power module
-Firepower for VMWare Management Center
Any suggestion would be appreciated. Thanks in advance.
Hello
You should check the download user under domain option. Download the users once belonging to a group is specified on the ad and then test the connection.
Thank you
Yogesh
-
Reference pages directory and the directory script
I have a small question on the reference to an include() file.
Let's say I'm on a Web page if there is a simple html login form and this page are in the directory called PAGES. The script for this form action is found in a file different ina directory named SCRIPTS.
The principle, I am trying to understand is:
If the connection is successful, then the user get access to the site. Now, since the form is located in a directory, but the form script is in another, where is the origin of the link, which will bring the user to the site? the login page with the shape origin or the script for the original form?
> even if the user is currently on the form?
If I understand the workflow you use, the visitor submits the form which is processed by "scripts/login.php". This script has the redirect code - so the url (mainpage.php) location is relative "scripts/login.php". So be, the redirect will fail unless mainpage.php is also in the scripts folder. If you need to enter the relative path of the correct document, or use a relative path from the root or an absolute path.
Once the user submits the form, they are more "on the form. They are on the page specified in the action of the form - even if there is no html code on this page.
-
to access the pots through the class-path to the manifest of a shared library.
I have a large number of pots that are used by the J2EE applications and stand-alone (client) applications.
I like to keep only one copy pots on the drive (for example, in a myLibraries/lib directory).
Is there a way I can create a shared library with the Class-Path entry in a manifest that points to the jar files in the myLibraries/lib directory? (If Yes, which? the ear of shared library manifest, the manifest of a pot of "module" in the ear of shared library or the manifest of a pot within the APP-INF/lib?)
Otherwise, it seems that I have to include copies of these pots in the EAR of my shared library application.
Thanks in advance
MikeMike,
I guess that it may be possible to refer to the pots where they are already using a manifest, but this isn't how I saw. If you look at weblogic.jar, it's META-INF/manfiest.mf uses references to other module pots. However, you're talking as if you want to do something more absolute path. Why not consider the following which is more standard...
To use a pot as a shared library or optional package, study it:
http://download.Oracle.com/docs/CD/E14571_01/Web.1111/e13706/libraries.htm#i1070930Basically, make sure that the jars you want to be a shared library have a manifest file which specifies the extension name, spec, and version impl.
For example. Let's say you have myExtension.jar - inside there should be a META-INF/MANIFEST. File MF that looks like this:
Name of the extension: myExtension
Specification-Version: 2.0
Implementation-Version: 9.0.0Deploy this jar in a WLS library.
Second, depending on which classloader you want to access in the container, make a reference to the optional package. For example, in the EAR that you want to access this pot, change META-INF/MANIFEST the EAR. MF so that it looks like this:
List of extensions: myExtension
myExtension-Extension-name: myExtension
myExtension-Specification-Version: 2.9
myExtension-application-Version: 9.0.0You can also reference the style jar libraries in weblogic application. The EAR like this XML:
...
myExtension
...
Note that the library-ref above referring to a jar approach does not work for applications packaged as WAR files and editing weblogic.xml, you must use the obvious approach for the web module archive jar base shared libraries reference.
-
launchd works but the script is run?
I have looked for answers here, but could not find them. So my question is this: I created a launchd like this: com.schedule.arp.plist
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.schedule.arp.plist</string> <key>ProgramArguments</key> <array> <string>/Library/Scripts/arp.sh</string> </array> <key>StartInterval</key> <integer>300</integer> </dict> </plist>
I can see that the computer runs every 5 minutes as it should. Here is the console:
Apr 21 09:46:39 eps-amsterdam com.apple.xpc.launchd [1] (com.schedule.arp.plist [2946]): Service came out with abnormal code: 1 Apr 21 09:51:39 eps-amsterdam com.apple.xpc.launchd [1] (com.schedule.arp.plist [3274]): Service came out with abnormal code: 1 Apr 21 09:56:39 eps-amsterdam com.apple.xpc.launchd [1] (com.schedule.arp.plist [3554]): Service came out with abnormal code: 1 Apr 21 10:01:39 eps-amsterdam com.apple.xpc.launchd [1] (com.schedule.arp.plist [4156]): Service came out with abnormal code: 1
The actual script is here:/Library/Scripts/arp.sh it contains the following:
#!/bin/sh sudo php56 /opt/local/apache2/htdocs/epsamsterdam/arpreach_full/a.php cli/auto
But this last part is not executed? Manual to hit this command in the terminal works very well. So where should I go wrong? I am running to El Capitan 10.11.4
First, if the job should run as root, it should be in/Library/LaunchDaemons with appropriate permissions (owned by and writable only by root). Eliminate the 'sudo' to the script. Provide the full paths to 'php56' and ' cli/auto '.
Maybe you are looking for
-
Why is the 200 GB $44.99 a plan inherited from year more expensive than the monthly plan the new 200 GB $2.99 a month plan ($35,88) - what's the catch here? is there a reason why the new plan is less expensive? they are trying to phase out the inheri
-
Cannot install Itunes 12.3.2.35
Hello Support! After the trouble of calling phone shooting as well as manually deleted files Apple and Hello! 12.3.2.35 iTunes installation has failed. Although installation of new files is complete without errors, the installation cannot complete. I
-
StripChart paused for a moment and resumed again
Hello I have showing graphic problem of the band. I created the x-axis in continuous mode. I update data using "PlotStripChart (DisplayHandle, Chart [idx].chartCtrl, PlotBuf [idx], 2,0,0, VAL_FLOAT)";. He did not always but sometimes watched table br
-
Not found Boot on HP Pavilion 11-h013dx x 2 pc device
I have a HP Pavilion 11-h013dx x 2 pc windows 8 and this weekend my computer suddenly switched off. When I restarted I got a blue screen which gave me the opportunity to restore and refresh. I tried both options, but the computer stops when that 15 p
-
Cannot delete all messages of unknown error has occurred
Today, I changed to Windows 7 from Windows 10. Everything seemed fine except that I can't delete all messages now. I get this message "an unknown error has occurred" can anyone help please